This commit is contained in:
Joe Bruno 2020-10-20 21:18:52 +02:00 committed by GitHub
commit 6592c5871a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -360,10 +360,14 @@ class YoutubePlaylistBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
class YoutubePlaylistsBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
def _process_page(self, content):
for playlist_id in orderedSet(re.findall(
r'<h3[^>]+class="[^"]*yt-lockup-title[^"]*"[^>]*><a[^>]+href="/?playlist\?list=([0-9A-Za-z-_]{10,})"',
content)):
yield self.url_result(
'https://www.youtube.com/playlist?list=%s' % playlist_id, 'YoutubePlaylist')
r'<h3[^>]+class="[^"]*yt-lockup-title[^"]*"[^>]*><a[^>]+href="/?playlist\?list=([0-9A-Za-z-_]{10,})"', content)):
playlistURL = 'https://www.youtube.com/playlist?list=%s' % playlist_id
# get the data from that page and grab the title
playlistTitle = self._og_search_title(self._download_webpage(playlistURL, playlist_id))
playlistTitle = playlistTitle[:playlistTitle.find(" -")]
yield self.url_result(playlistURL, 'YoutubePlaylist', video_title=playlistTitle)
def _real_extract(self, url):
playlist_id = self._match_id(url)