mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-04 10:42:51 +08:00
[youtube] Fallback instead of failing when title can't be determined
This commit is contained in:
parent
5035536e3f
commit
7cff2793bf
@ -1631,9 +1631,14 @@ class YoutubePlaylistIE(YoutubeBaseInfoExtractor, YoutubePlaylistBaseInfoExtract
|
||||
else:
|
||||
self.report_warning('Youtube gives an alert message: ' + match)
|
||||
|
||||
playlist_title = self._html_search_regex(
|
||||
r'(?s)<h1 class="pl-header-title[^"]*"[^>]*>\s*(.*?)\s*</h1>',
|
||||
page, 'title')
|
||||
playlist_title = str(playlist_id)
|
||||
|
||||
try:
|
||||
playlist_title = self._html_search_regex(
|
||||
r'(?s)<h1 class="pl-header-title[^"]*"[^>]*>\s*(.*?)\s*</h1>',
|
||||
page, 'title')
|
||||
except:
|
||||
self.report_warning('Cannot extract playlist title, using playlist id instead')
|
||||
|
||||
return self.playlist_result(self._entries(page, playlist_id), playlist_id, playlist_title)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user