diff --git a/youtube_dl/extractor/neteasemusic.py b/youtube_dl/extractor/neteasemusic.py index 435cd8e2ee..7830616f8f 100644 --- a/youtube_dl/extractor/neteasemusic.py +++ b/youtube_dl/extractor/neteasemusic.py @@ -12,7 +12,10 @@ 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 @@ def extract_formats(self, info): 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')