1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-18 00:05:46 +00:00

[Newgrounds] Apply suggestion

This commit is contained in:
u-spec-png 2021-08-26 18:24:44 +02:00
parent 39681044bc
commit f3da91008c

View file

@ -9,6 +9,7 @@ from ..utils import (
parse_duration,
parse_filesize,
parse_count,
parse_resolution,
unified_timestamp,
)
@ -83,15 +84,17 @@ class NewgroundsIE(InfoExtractor):
})
uploader = json_data.get('author')
media_formats = json_data.get('sources', [])
media_formats = json_data['sources']
for media_format in media_formats:
media_sources = media_formats[media_format]
for source in media_sources:
formats.append({
format = {
'format_id': media_format,
'quality': int_or_none(media_format[:-1]),
'url': source.get('src')
})
'url': source.get('src'),
}
format.update(parse_resolution(media_format))
format['quality'] = format.get('height')
formats.append(format)
if not uploader:
uploader = self._html_search_regex(