[youtube] Correct signature extraction error detection

This commit is contained in:
Philipp Hagemeister 2014-07-11 10:44:39 +02:00
parent 61989fb5e9
commit c8bf86d50d

View File

@ -865,7 +865,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
def _decrypt_signature(self, s, video_id, player_url, age_gate=False):
"""Turn the encrypted s field into a working signature"""
if player_url is not None:
if player_url is None:
raise ExtractorError(u'Cannot decrypt signature without player_url')
if player_url.startswith(u'//'):
player_url = u'https:' + player_url
try:
@ -884,9 +886,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
raise ExtractorError(
u'Automatic signature extraction failed: ' + tb, cause=e)
return self._static_decrypt_signature(
s, video_id, player_url, age_gate)
def _get_available_subtitles(self, video_id, webpage):
try:
sub_list = self._download_webpage(