[youtube] Expose different formats with same itag

This commit is contained in:
pukkandan 2021-10-16 20:13:23 +05:30
parent 03b4de722a
commit 580d3274e5
2 changed files with 7 additions and 3 deletions

View File

@ -1,6 +1,5 @@
from __future__ import division, unicode_literals from __future__ import division, unicode_literals
import copy
import os import os
import re import re
import time import time

View File

@ -2692,7 +2692,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
itag = self._search_regex( itag = self._search_regex(
r'/itag/(\d+)', f['url'], 'itag', default=None) r'/itag/(\d+)', f['url'], 'itag', default=None)
if itag in itags: if itag in itags:
continue itag += '-hls'
if itag in itags:
continue
if itag: if itag:
f['format_id'] = itag f['format_id'] = itag
itags.append(itag) itags.append(itag)
@ -2704,8 +2706,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
for f in self._extract_mpd_formats(dash_manifest_url, video_id, fatal=False): for f in self._extract_mpd_formats(dash_manifest_url, video_id, fatal=False):
itag = f['format_id'] itag = f['format_id']
if itag in itags: if itag in itags:
continue itag += '-dash'
if itag in itags:
continue
if itag: if itag:
f['format_id'] = itag
itags.append(itag) itags.append(itag)
f['quality'] = guess_quality(f) f['quality'] = guess_quality(f)
filesize = int_or_none(self._search_regex( filesize = int_or_none(self._search_regex(