projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a54fbf2
)
[neteasemusic] Use float_or_none
author
Yen Chi Hsuan
<yan12125@gmail.com>
Tue, 19 Jan 2016 20:21:51 +0000
(
04:21
+0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Tue, 19 Jan 2016 20:21:51 +0000
(
04:21
+0800)
youtube_dl/extractor/neteasemusic.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/neteasemusic.py
b/youtube_dl/extractor/neteasemusic.py
index 435cd8e2eeceb59f716f2871521595918cc9eb54..7830616f8fb9498c058504d52c199c6a69a9d98b 100644
(file)
--- a/
youtube_dl/extractor/neteasemusic.py
+++ b/
youtube_dl/extractor/neteasemusic.py
@@
-12,7
+12,10
@@
from ..compat import (
compat_str,
compat_itertools_count,
)
-from ..utils import sanitized_Request
+from ..utils import (
+ sanitized_Request,
+ float_or_none,
+)
class NetEaseMusicBaseIE(InfoExtractor):
@@
-52,7
+55,7
@@
class NetEaseMusicBaseIE(InfoExtractor):
formats.append({
'url': song_url,
'ext': details.get('extension'),
- 'abr':
details.get('bitrate', 0) / 1000
,
+ 'abr':
float_or_none(details.get('bitrate'), scale=1000)
,
'format_id': song_format,
'filesize': details.get('size'),
'asr': details.get('sr')