aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/utils.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-04-03 16:21:21 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-04-03 16:21:21 +0200
commit9271bc835546a8bd11c645018e9daabd54522855 (patch)
tree033032c696aca96b210205e44e76c56bc557477e /youtube_dl/utils.py
parent968ed2a7779fc7337fdcaa12da2b12e288e7eeb6 (diff)
[cnet] Add new extractor (Fixes #2679)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r--youtube_dl/utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index e54ea9d61..5f1f664c8 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -1176,12 +1176,12 @@ class HEADRequest(compat_urllib_request.Request):
return "HEAD"
-def int_or_none(v, scale=1):
- return v if v is None else (int(v) // scale)
+def int_or_none(v, scale=1, default=None):
+ return default if v is None else (int(v) // scale)
-def float_or_none(v, scale=1):
- return v if v is None else (float(v) / scale)
+def float_or_none(v, scale=1, default=None):
+ return default if v is None else (float(v) / scale)
def parse_duration(s):