diff options
author | Philipp Hagemeister <[email protected]> | 2014-04-21 13:45:27 +0200 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2014-04-21 13:46:41 +0200 |
commit | 28746fbd59bb18f77eeaab49e0e284b8f31d7325 (patch) | |
tree | d8e75b6b3d918ca55c19a828e45aa62654da971d /youtube_dl/utils.py | |
parent | 0321213c1197b784aed884b10d5d63c2b396805c (diff) | |
download | youtube-dl-28746fbd59bb18f77eeaab49e0e284b8f31d7325.tar.gz youtube-dl-28746fbd59bb18f77eeaab49e0e284b8f31d7325.zip |
[bilibili] Add preliminary support (#2174)
The URL http://www.bilibili.tv/video/av636603/index_2.html does not work yet.
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index d4df78071..9190a8fb8 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -1245,7 +1245,10 @@ class HEADRequest(compat_urllib_request.Request): return "HEAD" -def int_or_none(v, scale=1, default=None): +def int_or_none(v, scale=1, default=None, get_attr=None): + if get_attr: + if v is not None: + v = getattr(v, get_attr, None) return default if v is None else (int(v) // scale) |