[youtube:channel] Correct 404 handling

Previously, when we encountered a 404 - such as youtube-dl https://www.youtube.com/ohJeiboh8oorehai - we crashed with a regexp error. Instead, make sure to go on and eventually report a 404.
master
Philipp Hagemeister 2015-09-14 00:32:20 +02:00
parent 287be8c615
commit 2b3c254678
1 changed files with 9 additions and 6 deletions

View File

@ -1654,12 +1654,15 @@ class YoutubeChannelIE(InfoExtractor):
channel_page = self._download_webpage( channel_page = self._download_webpage(
url + '?view=57', channel_id, url + '?view=57', channel_id,
'Downloading channel page', fatal=False) 'Downloading channel page', fatal=False)
channel_playlist_id = self._html_search_meta( if channel_page is False:
'channelId', channel_page, 'channel id', default=None) channel_playlist_id = False
if not channel_playlist_id: else:
channel_playlist_id = self._search_regex( channel_playlist_id = self._html_search_meta(
r'data-channel-external-id="([^"]+)"', 'channelId', channel_page, 'channel id', default=None)
channel_page, 'channel id', default=None) if not channel_playlist_id:
channel_playlist_id = self._search_regex(
r'data-channel-external-id="([^"]+)"',
channel_page, 'channel id', default=None)
if channel_playlist_id and channel_playlist_id.startswith('UC'): if channel_playlist_id and channel_playlist_id.startswith('UC'):
playlist_id = 'UU' + channel_playlist_id[2:] playlist_id = 'UU' + channel_playlist_id[2:]
return self.url_result( return self.url_result(