mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-12 14:26:49 +01:00
[youtube] Expose different formats with same itag
This commit is contained in:
parent
03b4de722a
commit
580d3274e5
@ -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
|
||||||
|
@ -2691,6 +2691,8 @@ def guess_quality(f):
|
|||||||
for f in self._extract_m3u8_formats(hls_manifest_url, video_id, 'mp4', fatal=False):
|
for f in self._extract_m3u8_formats(hls_manifest_url, video_id, 'mp4', fatal=False):
|
||||||
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:
|
||||||
|
itag += '-hls'
|
||||||
if itag in itags:
|
if itag in itags:
|
||||||
continue
|
continue
|
||||||
if itag:
|
if itag:
|
||||||
@ -2703,9 +2705,12 @@ def guess_quality(f):
|
|||||||
if dash_manifest_url:
|
if dash_manifest_url:
|
||||||
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:
|
||||||
|
itag += '-dash'
|
||||||
if itag in itags:
|
if itag in itags:
|
||||||
continue
|
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(
|
||||||
|
Loading…
Reference in New Issue
Block a user