mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-12 02:01:05 +01:00
[youtube] Set the format_id field to the itag of the format (closes #1624)
This commit is contained in:
parent
ea32fbacc8
commit
600cc1a4f0
@ -1480,13 +1480,13 @@ def _real_extract(self, url):
|
|||||||
raise ExtractorError(u'no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')
|
raise ExtractorError(u'no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')
|
||||||
|
|
||||||
results = []
|
results = []
|
||||||
for format_param, video_real_url in video_url_list:
|
for itag, video_real_url in video_url_list:
|
||||||
# Extension
|
# Extension
|
||||||
video_extension = self._video_extensions.get(format_param, 'flv')
|
video_extension = self._video_extensions.get(itag, 'flv')
|
||||||
|
|
||||||
video_format = '{0} - {1}{2}'.format(format_param if format_param else video_extension,
|
video_format = '{0} - {1}{2}'.format(itag if itag else video_extension,
|
||||||
self._video_dimensions.get(format_param, '???'),
|
self._video_dimensions.get(itag, '???'),
|
||||||
' ('+self._special_itags[format_param]+')' if format_param in self._special_itags else '')
|
' ('+self._special_itags[itag]+')' if itag in self._special_itags else '')
|
||||||
|
|
||||||
results.append({
|
results.append({
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
@ -1497,6 +1497,7 @@ def _real_extract(self, url):
|
|||||||
'title': video_title,
|
'title': video_title,
|
||||||
'ext': video_extension,
|
'ext': video_extension,
|
||||||
'format': video_format,
|
'format': video_format,
|
||||||
|
'format_id': itag,
|
||||||
'thumbnail': video_thumbnail,
|
'thumbnail': video_thumbnail,
|
||||||
'description': video_description,
|
'description': video_description,
|
||||||
'player_url': player_url,
|
'player_url': player_url,
|
||||||
|
Loading…
Reference in New Issue
Block a user