diff options
author | anovicecodemonkey <anovicecodemonkey13435@mailinator.com> | 2014-05-21 19:04:55 +0930 |
---|---|---|
committer | anovicecodemonkey <anovicecodemonkey13435@mailinator.com> | 2014-05-21 19:04:55 +0930 |
commit | 212a5e28bae61f764e8e802e403a15cbe62f0dc6 (patch) | |
tree | 7df4f2602326d617817e9a11356b4dc2eccf5f7f /youtube_dl | |
parent | 3442b30ab2a5f168caa45a7371aca0f4103fdd86 (diff) | |
download | youtube-dl-212a5e28bae61f764e8e802e403a15cbe62f0dc6.tar.xz |
Add a duplicate check to /extractor/common.py playlist_result function
Diffstat (limited to 'youtube_dl')
-rw-r--r-- | youtube_dl/extractor/common.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index db472aace..26dd9882f 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -343,6 +343,16 @@ class InfoExtractor(object): @staticmethod def playlist_result(entries, playlist_id=None, playlist_title=None): """Returns a playlist""" + # Ensure we don't have any duplicates in the playlist + seen = set() + new_list = [] + for url in entries: + theurl = tuple(url.items()) + if theurl not in seen: + seen.add(theurl) + new_list.append(url) + entries = new_list + video_info = {'_type': 'playlist', 'entries': entries} if playlist_id: |