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

[youtube:playlist] Fix mixes extraction (fixes #3051)

The username seems to be empty now.
This commit is contained in:
Jaime Marquínez Ferrándiz 2014-06-05 21:21:15 +02:00
parent b3ae826f7a
commit 70e322695d

View File

@ -1414,11 +1414,9 @@ class YoutubePlaylistIE(YoutubeBaseInfoExtractor):
title_span = (search_title('playlist-title') or title_span = (search_title('playlist-title') or
search_title('title long-title') or search_title('title')) search_title('title long-title') or search_title('title'))
title = clean_html(title_span) title = clean_html(title_span)
video_re = r'''(?x)data-video-username="(.*?)".*? video_re = r'''(?x)data-video-username=".*?".*?
href="/watch\?v=([0-9A-Za-z_-]{11})&[^"]*?list=%s''' % re.escape(playlist_id) href="/watch\?v=([0-9A-Za-z_-]{11})&[^"]*?list=%s''' % re.escape(playlist_id)
matches = orderedSet(re.findall(video_re, webpage, flags=re.DOTALL)) ids = orderedSet(re.findall(video_re, webpage, flags=re.DOTALL))
# Some of the videos may have been deleted, their username field is empty
ids = [video_id for (username, video_id) in matches if username]
url_results = self._ids_to_results(ids) url_results = self._ids_to_results(ids)
return self.playlist_result(url_results, playlist_id, title) return self.playlist_result(url_results, playlist_id, title)