Browse Source

[youtube] Use sp field value for signature field name (closes #18841, closes #18927, closes #21028)

Sergey M․ 6 years ago
parent
commit
027ffdca0d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      youtube_dl/extractor/youtube.py

+ 2 - 1
youtube_dl/extractor/youtube.py

@@ -1987,7 +1987,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
 
                     signature = self._decrypt_signature(
                         encrypted_sig, video_id, player_url, age_gate)
-                    url += '&signature=' + signature
+                    sp = try_get(url_data, lambda x: x['sp'][0], compat_str) or 'signature'
+                    url += '&%s=%s' % (sp, signature)
                 if 'ratebypass' not in url:
                     url += '&ratebypass=yes'