[youtube] Correct signature extraction error detection
This commit is contained in:
parent
61989fb5e9
commit
c8bf86d50d
1 changed files with 19 additions and 20 deletions
|
@ -865,7 +865,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
|
||||||
def _decrypt_signature(self, s, video_id, player_url, age_gate=False):
|
def _decrypt_signature(self, s, video_id, player_url, age_gate=False):
|
||||||
"""Turn the encrypted s field into a working signature"""
|
"""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'//'):
|
if player_url.startswith(u'//'):
|
||||||
player_url = u'https:' + player_url
|
player_url = u'https:' + player_url
|
||||||
try:
|
try:
|
||||||
|
@ -884,9 +886,6 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
|
||||||
raise ExtractorError(
|
raise ExtractorError(
|
||||||
u'Automatic signature extraction failed: ' + tb, cause=e)
|
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):
|
def _get_available_subtitles(self, video_id, webpage):
|
||||||
try:
|
try:
|
||||||
sub_list = self._download_webpage(
|
sub_list = self._download_webpage(
|
||||||
|
|
Loading…
Reference in a new issue