1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-26 17:58:09 +00:00

[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): 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(