aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-01-20 04:21:51 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-01-20 04:21:51 +0800
commitfe6856b0595b85c8070d7ccc154cd8ac2ff85e2c (patch)
treee8b1c8646e56cbfc1d60374a54bf34c98d9d4e33
parenta54fbf2ca6a2b9cebb151c7af70d3949967e21b0 (diff)
[neteasemusic] Use float_or_none
-rw-r--r--youtube_dl/extractor/neteasemusic.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/extractor/neteasemusic.py b/youtube_dl/extractor/neteasemusic.py
index 435cd8e2e..7830616f8 100644
--- 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')