diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2014-03-28 23:06:34 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2014-03-28 23:06:34 +0100 |
commit | 43f775e4cade8868cda32bc71e3d84ed62665c58 (patch) | |
tree | db3e163c3784d932b382be32672410898ecf1a04 /youtube_dl/utils.py | |
parent | 8f6562448c7fe1ce6723300ed46c3f51a92c52ac (diff) |
[comedycentral] Duration can now be a float (Fixes #2647)
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 29c9b1a4c..b5326c0cb 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1181,6 +1181,10 @@ def int_or_none(v, scale=1): return v 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 parse_duration(s): if s is None: return None |