From: anovicecodemonkey Date: Wed, 21 May 2014 09:34:55 +0000 (+0930) Subject: Add a duplicate check to /extractor/common.py playlist_result function X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=212a5e28bae61f764e8e802e403a15cbe62f0dc6;p=youtube-dl Add a duplicate check to /extractor/common.py playlist_result function --- 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: