mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
[extractor/common] remove duplicate rtmp formats in smil manifest
This commit is contained in:
parent
388ae76b52
commit
81e1c4e2fc
1 changed files with 3 additions and 5 deletions
|
@ -1186,12 +1186,13 @@ def _parse_smil_formats(self, smil, smil_url, video_id, namespace=None, f4m_para
|
|||
http_count = 0
|
||||
m3u8_count = 0
|
||||
|
||||
src_urls = []
|
||||
srcs = []
|
||||
videos = smil.findall(self._xpath_ns('.//video', namespace))
|
||||
for video in videos:
|
||||
src = video.get('src')
|
||||
if not src:
|
||||
if not src or src in srcs:
|
||||
continue
|
||||
srcs.append(src)
|
||||
|
||||
bitrate = float_or_none(video.get('system-bitrate') or video.get('systemBitrate'), 1000)
|
||||
filesize = int_or_none(video.get('size') or video.get('fileSize'))
|
||||
|
@ -1223,9 +1224,6 @@ def _parse_smil_formats(self, smil, smil_url, video_id, namespace=None, f4m_para
|
|||
continue
|
||||
|
||||
src_url = src if src.startswith('http') else compat_urlparse.urljoin(base, src)
|
||||
if src_url in src_urls:
|
||||
continue
|
||||
src_urls.append(src_url)
|
||||
|
||||
if proto == 'm3u8' or src_ext == 'm3u8':
|
||||
m3u8_formats = self._extract_m3u8_formats(
|
||||
|
|
Loading…
Reference in a new issue