1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-22 01:52:51 +08:00

Add a duplicate check to /extractor/common.py playlist_result function

This commit is contained in:
anovicecodemonkey 2014-05-21 19:04:55 +09:30
parent 3442b30ab2
commit 212a5e28ba

View File

@ -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: