[youtube] fix 403 forbidden error

youtube has new 'sp' paramter in url_data which gives signature param name that
server is expecting for the signature param value in url
This commit is contained in:
Davinder Singh 2019-01-20 01:47:29 +00:00
parent 379306ef55
commit 924d479fd8
No known key found for this signature in database
GPG Key ID: B6444BCF156B4422

View File

@ -1886,7 +1886,10 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
signature = self._decrypt_signature(
encrypted_sig, video_id, player_url, age_gate)
url += '&signature=' + signature
if 'sp' in url_data:
url += '&' + url_data['sp'][0] + '=' + signature
else:
url += '&signature=' + signature
if 'ratebypass' not in url:
url += '&ratebypass=yes'