diff options
author | Filippo Valsorda <[email protected]> | 2013-06-27 12:54:07 +0200 |
---|---|---|
committer | Filippo Valsorda <[email protected]> | 2013-06-27 12:54:07 +0200 |
commit | 769fda3c5a82c1dafc2a0419cea785e97267a454 (patch) | |
tree | 21ae41b5f649b5d862489c769d25c931d7a6862a | |
parent | 23300d71493a72e51053efbf5fbdb9fef0544336 (diff) | |
download | youtube-dl-769fda3c5a82c1dafc2a0419cea785e97267a454.tar.gz youtube-dl-769fda3c5a82c1dafc2a0419cea785e97267a454.zip |
print more encrypted signature info on -v (rel: #948)
-rw-r--r-- | youtube_dl/extractor/youtube.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 997278cab..c7922c533 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -131,8 +131,6 @@ class YoutubeIE(InfoExtractor): def _decrypt_signature(self, s): """Decrypt the key the two subkeys must have a length of 43""" - if self._downloader.params.get('verbose'): - self.to_screen('encrypted signature length %d' % (len(s))) if len(s) == 88: return s[48] + s[81:67:-1] + s[82] + s[66:62:-1] + s[85] + s[61:48:-1] + s[67] + s[47:12:-1] + s[3] + s[11:3:-1] + s[2] + s[12] @@ -520,6 +518,12 @@ class YoutubeIE(InfoExtractor): if 'sig' in url_data: url += '&signature=' + url_data['sig'][0] elif 's' in url_data: + if self._downloader.params.get('verbose'): + s = url_data['s'][0] + player = self._search_regex(r'html5player-(.+?)\.js', video_webpage, + 'html5 player', fatal=False) + self.to_screen('encrypted signature length %d (%d.%d), itag %s, html5 player %s' % + (len(s), len(s.split('.')[0]), len(s.split('.')[1]), url_data['itag'][0], player)) signature = self._decrypt_signature(url_data['s'][0]) url += '&signature=' + signature if 'ratebypass' not in url: |