mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-04-28 03:25:52 +00:00
Fix fragment url generation
This commit is contained in:
parent
ff90e3852f
commit
d9a92921e6
@ -1855,7 +1855,7 @@ class InfoExtractor:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def _remove_duplicate_formats(formats):
|
def _remove_duplicate_formats(formats):
|
||||||
seen_urls = set()
|
seen_urls = set()
|
||||||
seen_fragments = set()
|
seen_fragment_urls = set()
|
||||||
unique_formats = []
|
unique_formats = []
|
||||||
for f in formats:
|
for f in formats:
|
||||||
fragments = f.get('fragments')
|
fragments = f.get('fragments')
|
||||||
@ -1863,12 +1863,11 @@ class InfoExtractor:
|
|||||||
unique_formats.append(f)
|
unique_formats.append(f)
|
||||||
|
|
||||||
elif fragments:
|
elif fragments:
|
||||||
if base_url := f.get('fragment_base_url'):
|
fragment_urls = frozenset(
|
||||||
fragments = map(urljoin(base_url), fragments)
|
fragment.get('url') or urljoin(f['fragment_base_url'], fragment['path'])
|
||||||
|
for fragment in fragments)
|
||||||
fragments = frozenset(fragments)
|
if fragment_urls not in seen_fragment_urls:
|
||||||
if fragments not in seen_fragments:
|
seen_fragment_urls.add(fragment_urls)
|
||||||
seen_fragments.add(fragments)
|
|
||||||
unique_formats.append(f)
|
unique_formats.append(f)
|
||||||
|
|
||||||
elif f['url'] not in seen_urls:
|
elif f['url'] not in seen_urls:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user