mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-30 04:10:23 +00:00
Don't list master m3u8 playlists in format list (closes #12832)
This commit is contained in:
parent
e8bfe2a946
commit
ff99fe529e
@ -184,14 +184,6 @@ def test_parse_m3u8_formats(self):
|
|||||||
'pluzz_francetv_11507',
|
'pluzz_francetv_11507',
|
||||||
'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/master.m3u8?caption=2017%2F16%2F156589847-1492488987.m3u8%3Afra%3AFrancais&audiotrack=0%3Afra%3AFrancais',
|
'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/master.m3u8?caption=2017%2F16%2F156589847-1492488987.m3u8%3Afra%3AFrancais&audiotrack=0%3Afra%3AFrancais',
|
||||||
[{
|
[{
|
||||||
'url': 'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/master.m3u8?caption=2017%2F16%2F156589847-1492488987.m3u8%3Afra%3AFrancais&audiotrack=0%3Afra%3AFrancais',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'format_id': 'meta',
|
|
||||||
'format_note': 'Quality selection URL',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
'preference': -100,
|
|
||||||
'resolution': 'multiple'
|
|
||||||
}, {
|
|
||||||
'url': 'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/index_0_av.m3u8?null=0',
|
'url': 'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/index_0_av.m3u8?null=0',
|
||||||
'manifest_url': 'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/index_0_av.m3u8?null=0',
|
'manifest_url': 'http://replayftv-vh.akamaihd.net/i/streaming-adaptatif_france-dom-tom/2017/S16/J2/156589847-58f59130c1f52-,standard1,standard2,standard3,standard4,standard5,.mp4.csmil/index_0_av.m3u8?null=0',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -254,14 +246,6 @@ def test_parse_m3u8_formats(self):
|
|||||||
'teamcoco_11995',
|
'teamcoco_11995',
|
||||||
'http://ak.storage-w.teamcococdn.com/cdn/2017-02/98599/ed8f/main.m3u8',
|
'http://ak.storage-w.teamcococdn.com/cdn/2017-02/98599/ed8f/main.m3u8',
|
||||||
[{
|
[{
|
||||||
'url': 'http://ak.storage-w.teamcococdn.com/cdn/2017-02/98599/ed8f/main.m3u8',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'format_id': 'meta',
|
|
||||||
'format_note': 'Quality selection URL',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
'preference': -100,
|
|
||||||
'resolution': 'multiple',
|
|
||||||
}, {
|
|
||||||
'url': 'http://ak.storage-w.teamcococdn.com/cdn/2017-02/98599/ed8f/hls/CONAN_020217_Highlight_show-audio-160k_v4.m3u8',
|
'url': 'http://ak.storage-w.teamcococdn.com/cdn/2017-02/98599/ed8f/hls/CONAN_020217_Highlight_show-audio-160k_v4.m3u8',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'format_id': 'audio-0-Default',
|
'format_id': 'audio-0-Default',
|
||||||
@ -334,14 +318,6 @@ def test_parse_m3u8_formats(self):
|
|||||||
'toggle_mobile_12211',
|
'toggle_mobile_12211',
|
||||||
'http://cdnapi.kaltura.com/p/2082311/sp/208231100/playManifest/protocol/http/entryId/0_89q6e8ku/format/applehttp/tags/mobile_sd/f/a.m3u8',
|
'http://cdnapi.kaltura.com/p/2082311/sp/208231100/playManifest/protocol/http/entryId/0_89q6e8ku/format/applehttp/tags/mobile_sd/f/a.m3u8',
|
||||||
[{
|
[{
|
||||||
'url': 'http://cdnapi.kaltura.com/p/2082311/sp/208231100/playManifest/protocol/http/entryId/0_89q6e8ku/format/applehttp/tags/mobile_sd/f/a.m3u8',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'format_id': 'meta',
|
|
||||||
'format_note': 'Quality selection URL',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
'preference': -100,
|
|
||||||
'resolution': 'multiple'
|
|
||||||
}, {
|
|
||||||
'url': 'http://k.toggle.sg/fhls/p/2082311/sp/208231100/serveFlavor/entryId/0_89q6e8ku/v/2/pv/1/flavorId/0_sa2ntrdg/name/a.mp4/index.m3u8',
|
'url': 'http://k.toggle.sg/fhls/p/2082311/sp/208231100/serveFlavor/entryId/0_89q6e8ku/v/2/pv/1/flavorId/0_sa2ntrdg/name/a.mp4/index.m3u8',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'format_id': 'audio-English',
|
'format_id': 'audio-English',
|
||||||
@ -398,14 +374,6 @@ def test_parse_m3u8_formats(self):
|
|||||||
'twitch_vod',
|
'twitch_vod',
|
||||||
'https://usher.ttvnw.net/vod/6528877?allow_source=true&allow_audio_only=true&allow_spectre=true&player=twitchweb&nauth=%7B%22user_id%22%3Anull%2C%22vod_id%22%3A6528877%2C%22expires%22%3A1492887874%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22privileged%22%3Afalse%2C%22https_required%22%3Afalse%7D&nauthsig=3e29296a6824a0f48f9e731383f77a614fc79bee',
|
'https://usher.ttvnw.net/vod/6528877?allow_source=true&allow_audio_only=true&allow_spectre=true&player=twitchweb&nauth=%7B%22user_id%22%3Anull%2C%22vod_id%22%3A6528877%2C%22expires%22%3A1492887874%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22privileged%22%3Afalse%2C%22https_required%22%3Afalse%7D&nauthsig=3e29296a6824a0f48f9e731383f77a614fc79bee',
|
||||||
[{
|
[{
|
||||||
'url': 'https://usher.ttvnw.net/vod/6528877?allow_source=true&allow_audio_only=true&allow_spectre=true&player=twitchweb&nauth=%7B%22user_id%22%3Anull%2C%22vod_id%22%3A6528877%2C%22expires%22%3A1492887874%2C%22chansub%22%3A%7B%22restricted_bitrates%22%3A%5B%5D%7D%2C%22privileged%22%3Afalse%2C%22https_required%22%3Afalse%7D&nauthsig=3e29296a6824a0f48f9e731383f77a614fc79bee',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'format_id': 'meta',
|
|
||||||
'format_note': 'Quality selection URL',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
'preference': -100,
|
|
||||||
'resolution': 'multiple'
|
|
||||||
}, {
|
|
||||||
'url': 'https://vod.edgecast.hls.ttvnw.net/e5da31ab49_riotgames_15001215120_261543898/audio_only/index-muted-HM49I092CC.m3u8',
|
'url': 'https://vod.edgecast.hls.ttvnw.net/e5da31ab49_riotgames_15001215120_261543898/audio_only/index-muted-HM49I092CC.m3u8',
|
||||||
'manifest_url': 'https://vod.edgecast.hls.ttvnw.net/e5da31ab49_riotgames_15001215120_261543898/audio_only/index-muted-HM49I092CC.m3u8',
|
'manifest_url': 'https://vod.edgecast.hls.ttvnw.net/e5da31ab49_riotgames_15001215120_261543898/audio_only/index-muted-HM49I092CC.m3u8',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
@ -478,14 +446,6 @@ def test_parse_m3u8_formats(self):
|
|||||||
'vidio',
|
'vidio',
|
||||||
'https://www.vidio.com/videos/165683/playlist.m3u8',
|
'https://www.vidio.com/videos/165683/playlist.m3u8',
|
||||||
[{
|
[{
|
||||||
'url': 'https://www.vidio.com/videos/165683/playlist.m3u8',
|
|
||||||
'ext': 'mp4',
|
|
||||||
'format_id': 'meta',
|
|
||||||
'format_note': 'Quality selection URL',
|
|
||||||
'protocol': 'm3u8',
|
|
||||||
'preference': -100,
|
|
||||||
'resolution': 'multiple'
|
|
||||||
}, {
|
|
||||||
'url': 'https://cdn1-a.production.vidio.static6.com/uploads/165683/dj_ambred-4383-b300.mp4.m3u8',
|
'url': 'https://cdn1-a.production.vidio.static6.com/uploads/165683/dj_ambred-4383-b300.mp4.m3u8',
|
||||||
'manifest_url': 'https://cdn1-a.production.vidio.static6.com/uploads/165683/dj_ambred-4383-b300.mp4.m3u8',
|
'manifest_url': 'https://cdn1-a.production.vidio.static6.com/uploads/165683/dj_ambred-4383-b300.mp4.m3u8',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
|
@ -178,12 +178,7 @@ def _get_anvato_videos(self, access_key, video_id):
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ext == 'm3u8' or media_format in ('m3u8', 'm3u8-variant'):
|
if ext == 'm3u8' or media_format in ('m3u8', 'm3u8-variant'):
|
||||||
# Not using _extract_m3u8_formats here as individual media
|
if tbr is not None:
|
||||||
# playlists are also included in published_urls.
|
|
||||||
if tbr is None:
|
|
||||||
formats.append(self._m3u8_meta_format(video_url, ext='mp4', m3u8_id='hls'))
|
|
||||||
continue
|
|
||||||
else:
|
|
||||||
a_format.update({
|
a_format.update({
|
||||||
'format_id': '-'.join(filter(None, ['hls', compat_str(tbr)])),
|
'format_id': '-'.join(filter(None, ['hls', compat_str(tbr)])),
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
|
@ -1334,7 +1334,7 @@ def _parse_m3u8_formats(self, m3u8_doc, m3u8_url, ext=None,
|
|||||||
if '#EXT-X-FAXS-CM:' in m3u8_doc: # Adobe Flash Access
|
if '#EXT-X-FAXS-CM:' in m3u8_doc: # Adobe Flash Access
|
||||||
return []
|
return []
|
||||||
|
|
||||||
formats = [self._m3u8_meta_format(m3u8_url, ext, preference, m3u8_id)]
|
formats = []
|
||||||
|
|
||||||
format_url = lambda u: (
|
format_url = lambda u: (
|
||||||
u
|
u
|
||||||
@ -1438,7 +1438,7 @@ def build_stream_name():
|
|||||||
f = {
|
f = {
|
||||||
'format_id': '-'.join(format_id),
|
'format_id': '-'.join(format_id),
|
||||||
'url': manifest_url,
|
'url': manifest_url,
|
||||||
'manifest_url': manifest_url,
|
'manifest_url': m3u8_url,
|
||||||
'tbr': tbr,
|
'tbr': tbr,
|
||||||
'ext': ext,
|
'ext': ext,
|
||||||
'fps': float_or_none(last_stream_inf.get('FRAME-RATE')),
|
'fps': float_or_none(last_stream_inf.get('FRAME-RATE')),
|
||||||
|
@ -58,8 +58,7 @@ def _real_extract(self, url):
|
|||||||
m3u8_url, video_id, 'mp4', 'm3u8_native',
|
m3u8_url, video_id, 'mp4', 'm3u8_native',
|
||||||
m3u8_id='hls', fatal=False)
|
m3u8_id='hls', fatal=False)
|
||||||
source_formats = list(filter(
|
source_formats = list(filter(
|
||||||
lambda f: f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('vcodec') != 'none', m3u8_formats))
|
||||||
m3u8_formats))
|
|
||||||
|
|
||||||
bitrates = [int(bitrate) for bitrate in re.findall(r'[,/]v(\d+)(?=[,/])', m3u8_url)]
|
bitrates = [int(bitrate) for bitrate in re.findall(r'[,/]v(\d+)(?=[,/])', m3u8_url)]
|
||||||
bitrates.sort()
|
bitrates.sort()
|
||||||
|
@ -78,8 +78,7 @@ def _real_extract(self, url):
|
|||||||
if m3u8_formats:
|
if m3u8_formats:
|
||||||
self._sort_formats(m3u8_formats)
|
self._sort_formats(m3u8_formats)
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('vcodec') != 'none', m3u8_formats))
|
||||||
m3u8_formats))
|
|
||||||
if len(qualities) == len(m3u8_formats):
|
if len(qualities) == len(m3u8_formats):
|
||||||
for q, m3u8_format in zip(qualities, m3u8_formats):
|
for q, m3u8_format in zip(qualities, m3u8_formats):
|
||||||
f = m3u8_format.copy()
|
f = m3u8_format.copy()
|
||||||
|
@ -86,7 +86,7 @@ def _real_extract(self, url):
|
|||||||
formats = self._extract_akamai_formats(
|
formats = self._extract_akamai_formats(
|
||||||
'%si/s/public/%s_,%s,.mp4.csmil/master.m3u8' % (streaming_base, path, streaming_path), video_id)
|
'%si/s/public/%s_,%s,.mp4.csmil/master.m3u8' % (streaming_base, path, streaming_path), video_id)
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('protocol') == 'm3u8_native' and f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('protocol') == 'm3u8_native' and f.get('vcodec') != 'none',
|
||||||
formats))
|
formats))
|
||||||
if len(m3u8_formats) == len(self._BITRATES):
|
if len(m3u8_formats) == len(self._BITRATES):
|
||||||
self._sort_formats(m3u8_formats)
|
self._sort_formats(m3u8_formats)
|
||||||
|
@ -515,7 +515,7 @@ def extract_redirect_urls(info):
|
|||||||
http_url = format_url
|
http_url = format_url
|
||||||
self._remove_duplicate_formats(formats)
|
self._remove_duplicate_formats(formats)
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('protocol') == 'm3u8' and f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('protocol') == 'm3u8' and f.get('vcodec') != 'none',
|
||||||
formats))
|
formats))
|
||||||
if http_url:
|
if http_url:
|
||||||
for m3u8_format in m3u8_formats:
|
for m3u8_format in m3u8_formats:
|
||||||
|
@ -62,8 +62,7 @@ def _real_extract(self, url):
|
|||||||
# m3u8 format always matches the http format, let's copy metadata from
|
# m3u8 format always matches the http format, let's copy metadata from
|
||||||
# one to another
|
# one to another
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('vcodec') != 'none', formats))
|
||||||
formats))
|
|
||||||
if len(m3u8_formats) == 1:
|
if len(m3u8_formats) == 1:
|
||||||
f_copy = m3u8_formats[0].copy()
|
f_copy = m3u8_formats[0].copy()
|
||||||
f_copy.update(f)
|
f_copy.update(f)
|
||||||
|
@ -210,7 +210,7 @@ def _talk_info(self, url, video_name):
|
|||||||
resources.get('stream'), video_name, 'mp4', m3u8_id=format_id, fatal=False))
|
resources.get('stream'), video_name, 'mp4', m3u8_id=format_id, fatal=False))
|
||||||
|
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('protocol') == 'm3u8' and f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('protocol') == 'm3u8' and f.get('vcodec') != 'none',
|
||||||
formats))
|
formats))
|
||||||
if http_url:
|
if http_url:
|
||||||
for m3u8_format in m3u8_formats:
|
for m3u8_format in m3u8_formats:
|
||||||
|
@ -150,8 +150,7 @@ def _real_extract(self, url):
|
|||||||
'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)
|
'mp4', 'm3u8_native', m3u8_id='hls', fatal=False)
|
||||||
self._sort_formats(m3u8_formats)
|
self._sort_formats(m3u8_formats)
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('vcodec') != 'none', m3u8_formats))
|
||||||
m3u8_formats))
|
|
||||||
formats.extend(m3u8_formats)
|
formats.extend(m3u8_formats)
|
||||||
for i, m3u8_format in enumerate(m3u8_formats, 2):
|
for i, m3u8_format in enumerate(m3u8_formats, 2):
|
||||||
http_url = '%s-%d.mp4' % (video_url_base, i)
|
http_url = '%s-%d.mp4' % (video_url_base, i)
|
||||||
|
@ -176,8 +176,7 @@ def concat(suffix, sep='-'):
|
|||||||
if m3u8_formats:
|
if m3u8_formats:
|
||||||
self._sort_formats(m3u8_formats)
|
self._sort_formats(m3u8_formats)
|
||||||
m3u8_formats = list(filter(
|
m3u8_formats = list(filter(
|
||||||
lambda f: f.get('vcodec') != 'none' and f.get('resolution') != 'multiple',
|
lambda f: f.get('vcodec') != 'none', m3u8_formats))
|
||||||
m3u8_formats))
|
|
||||||
if len(qualities) == len(m3u8_formats):
|
if len(qualities) == len(m3u8_formats):
|
||||||
for q, m3u8_format in zip(qualities, m3u8_formats):
|
for q, m3u8_format in zip(qualities, m3u8_formats):
|
||||||
f = m3u8_format.copy()
|
f = m3u8_format.copy()
|
||||||
|
Loading…
Reference in New Issue
Block a user