[youtube] Use 'orderedSet' instead of 'set' to preserve the order
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 31 Jan 2016 14:11:00 +0000 (15:11 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sun, 31 Jan 2016 14:11:00 +0000 (15:11 +0100)
youtube_dl/extractor/youtube.py

index 9a64c1d114455bdf8df048ba88e3a17dedf5370e..bd87c75b6b6e19ba562c041e0140b9b964cce82b 100644 (file)
@@ -233,7 +233,7 @@ class YoutubePlaylistBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
 
 class YoutubePlaylistsBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
     def _process_page(self, content):
-        for playlist_id in set(re.findall(r'href="/?playlist\?list=([0-9A-Za-z-_]{10,})"', content)):
+        for playlist_id in orderedSet(re.findall(r'href="/?playlist\?list=([0-9A-Za-z-_]{10,})"', content)):
             yield self.url_result(
                 'https://www.youtube.com/playlist?list=%s' % playlist_id, 'YoutubePlaylist')