diff options
author | Remita Amine <[email protected]> | 2021-03-12 18:11:11 +0100 |
---|---|---|
committer | Remita Amine <[email protected]> | 2021-03-12 18:11:11 +0100 |
commit | 1182f9567b86f2af747cdb8769ab87649c8ce4c2 (patch) | |
tree | 3eefd0a6fb5d75272f9b7f1eb90c78bc059207c4 | |
parent | ef414343e5fa2bc4fddae3097ecde5a8e32c2d4c (diff) | |
download | youtube-dl-1182f9567b86f2af747cdb8769ab87649c8ce4c2.tar.gz youtube-dl-1182f9567b86f2af747cdb8769ab87649c8ce4c2.zip |
[pinterest] reduce the number of HLS format requests
-rw-r--r-- | youtube_dl/extractor/pinterest.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/pinterest.py b/youtube_dl/extractor/pinterest.py index b249c9eda..42528d746 100644 --- a/youtube_dl/extractor/pinterest.py +++ b/youtube_dl/extractor/pinterest.py @@ -31,6 +31,7 @@ class PinterestBaseIE(InfoExtractor): title = (data.get('title') or data.get('grid_title') or video_id).strip() + urls = [] formats = [] duration = None if extract_formats: @@ -38,8 +39,9 @@ class PinterestBaseIE(InfoExtractor): if not isinstance(format_dict, dict): continue format_url = url_or_none(format_dict.get('url')) - if not format_url: + if not format_url or format_url in urls: continue + urls.append(format_url) duration = float_or_none(format_dict.get('duration'), scale=1000) ext = determine_ext(format_url) if 'hls' in format_id.lower() or ext == 'm3u8': |