Update youtube.py
Changed playlist search result urls to provide video id and playlist id.
This commit is contained in:
parent
438ec47af3
commit
5f6f4fda9b
@ -332,7 +332,7 @@ class YoutubePlaylistBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
|
||||
yield self.url_result(video_id, 'Youtube', video_id, video_title, video_duration)
|
||||
elif len(video_id) > 11:
|
||||
# Youtube playlist id found
|
||||
yield self.url_result('https://www.youtube.com/playlist?list=%s' % video_id, 'YoutubePlaylist', video_id, video_title)
|
||||
yield self.url_result('https://www.youtube.com/watch?v=%s&list=%s' % (video_id.split(';')[0], video_id.split(';')[1]), 'YoutubePlaylist', video_id, video_title)
|
||||
|
||||
def extract_videos_from_page_impl(self, video_re, page, ids_in_page, titles_in_page, durations_in_page):
|
||||
for mobj in re.finditer(video_re, page):
|
||||
@ -342,7 +342,7 @@ class YoutubePlaylistBaseInfoExtractor(YoutubeEntryListBaseInfoExtractor):
|
||||
video_id = mobj.group('id')
|
||||
playlist_id = mobj.group('plid') if 'plid' in mobj.groupdict() else None
|
||||
if playlist_id is not None:
|
||||
video_id = playlist_id
|
||||
video_id = video_id + ';' + playlist_id
|
||||
video_title = unescapeHTML(mobj.group('title')) if 'title' in mobj.groupdict() else None
|
||||
if video_title:
|
||||
video_title = video_title.strip()
|
||||
|
Loading…
x
Reference in New Issue
Block a user