Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YouTube: Cannot decrypt signature without player_url #3270

Closed
ivan opened this issue Jul 16, 2014 · 12 comments
Closed

YouTube: Cannot decrypt signature without player_url #3270

ivan opened this issue Jul 16, 2014 · 12 comments

Comments

@ivan
Copy link
Contributor

@ivan ivan commented Jul 16, 2014

Failing on https://www.youtube.com/watch?v=PTFwQP86BRs, which is VEVO + Content Warning + Flash only:

# python -m youtube_dl --verbose "https://www.youtube.com/watch?v=PTFwQP86BRs" 
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=PTFwQP86BRs']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.15
[debug] Git HEAD: ee90dda
[debug] Python version 2.7.6 - Linux-3.13.0-30-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] Proxy map: {}
[youtube] Setting language
[youtube] PTFwQP86BRs: Downloading webpage
[youtube] PTFwQP86BRs: Downloading video info webpage
[youtube] Confirming age
[youtube] PTFwQP86BRs: Extracting video information
[youtube] encrypted signature length 86 (42.43), itag 43, flash player unknown
ERROR: Cannot decrypt signature without player_url; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
Traceback (most recent call last):
  File "youtube_dl/extractor/youtube.py", line 1174, in _real_extract
    raise ValueError(u'No stream_map present')  # caught below
ValueError: No stream_map present
Traceback (most recent call last):
  File "youtube_dl/YoutubeDL.py", line 516, in extract_info
    ie_result = ie.extract(url)
  File "youtube_dl/extractor/common.py", line 168, in extract
    return self._real_extract(url)
  File "youtube_dl/extractor/youtube.py", line 1249, in _real_extract
    encrypted_sig, video_id, player_url, age_gate)
  File "youtube_dl/extractor/youtube.py", line 869, in _decrypt_signature
    raise ExtractorError(u'Cannot decrypt signature without player_url')
ExtractorError: Cannot decrypt signature without player_url; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type  youtube-dl -U  to update.
@zsrinivas
Copy link

@zsrinivas zsrinivas commented Jul 16, 2014

but it is perfectly working under my system

[eightnoteight@mr workshop]$ python -m youtube_dl --verbose https://www.youtube.com/watch?v=PTFwQP86BRs
[debug] System config: []
[debug] User config: []
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=PTFwQP86BRs']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.06.26
[debug] Python version 2.7.5 - Linux-3.14.8-200.fc20.x86_64-x86_64-with-fedora-20-Heisenbug
[debug] Proxy map: {}
[youtube] Setting language
[youtube] PTFwQP86BRs: Downloading webpage
[youtube] PTFwQP86BRs: Downloading video info webpage
[youtube] Confirming age
[youtube] PTFwQP86BRs: Extracting video information
[youtube] encrypted signature length 86 (42.43), itag 43, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 18, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 5, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 36, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 17, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 135, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 244, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 134, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 243, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 133, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 242, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 160, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 140, flash player unknown
[youtube] encrypted signature length 86 (42.43), itag 171, flash player unknown
[download] Destination: Nine Inch Nails - Closer (Director's Cut)-PTFwQP86BRs.mp4
[download]   1.5% of 16.53MiB at 207.60KiB/s ETA 01:20^C
ERROR: Interrupted by user
[eightnoteight@mr workshop]$ 

my version is 2014.06.19. what is your version

jaimeMF added a commit that referenced this issue Jul 16, 2014
@ivan
Copy link
Contributor Author

@ivan ivan commented Jul 16, 2014

Thanks @jaimeMF, it works here with your 1b26296

@phihag
Copy link
Contributor

@phihag phihag commented Jul 20, 2014

Fixed in youtube-dl 2014.07.20. Thank you for the report!

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 20, 2014

@phihag I'm getting a HTTP Error 403: Forbidden now:

youtube-dl test:youtube_2 --no-cache-dir
[debug] System config: []
[debug] User config: ['--keep-video', '--write-info-json', '--write-thumbnail', '--verbose']
[debug] Command-line args: ['test:youtube_2', '--no-cache-dir']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2014.07.20
[debug] Git HEAD: cceb5ec
[debug] Python version 3.4.1 - Darwin-13.3.0-x86_64-i386-64bit
[debug] Proxy map: {}
[TestURL] Test URL: https://www.youtube.com/watch?v=07FYdnEawAQ
[youtube] Setting language
[youtube] 07FYdnEawAQ: Downloading webpage
[youtube] 07FYdnEawAQ: Downloading video info webpage
[youtube] Confirming age
[youtube] 07FYdnEawAQ: Extracting video information
[youtube] encrypted signature length 86 (42.43), itag 22, flash player vflmDyk47/watch_as3
[youtube] 07FYdnEawAQ: Downloading swf player vflmDyk47
[youtube] encrypted signature length 86 (42.43), itag 43, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 18, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 5, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 36, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 17, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 137, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 248, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 136, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 247, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 135, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 244, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 245, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 84 (40.43), itag 246, flash player vflmDyk47/watch_as3
[youtube] 07FYdnEawAQ: Downloading swf player vflmDyk47
[youtube] encrypted signature length 86 (42.43), itag 134, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 243, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 133, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 242, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 160, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 140, flash player vflmDyk47/watch_as3
[youtube] encrypted signature length 86 (42.43), itag 171, flash player vflmDyk47/watch_as3
[info] Writing video description metadata as JSON to: Justin Timberlake - Tunnel Vision (Explicit)-07FYdnEawAQ.info.json
[youtube] 07FYdnEawAQ: Downloading thumbnail ...
[youtube] 07FYdnEawAQ: Writing thumbnail to: Justin Timberlake - Tunnel Vision (Explicit)-07FYdnEawAQ.jpg
[debug] Invoking downloader on 'https://r9---sn-h5q7dn7l.googlevideo.com/videoplayback?ratebypass=yes&mws=yes&sver=3&mt=1405875846&ms=au&itag=22&ipbits=0&ip=83.32.202.195&key=yt5&expire=1405900800&mv=m&upn=i2EA5y0pUTM&source=youtube&fexp=902408%2C907253%2C914095%2C924222%2C927622%2C929305%2C930008%2C934024%2C934030%2C936209%2C940666%2C946013&id=o-AGpxC27NKsOg7deknQpTDZOnaDg55pbd9WejpWoQV5aP&sparams=id%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Cratebypass%2Crequiressl%2Csource%2Cupn%2Cexpire&requiressl=yes&initcwndbps=1262000&signature=E988B7720F49229BD72C94F401E1EE5B02E811D0.7CE6D0C971BCAC0DB5D2C5172FF97D1BA927F5'
ERROR: unable to download video data: HTTP Error 403: Forbidden
Traceback (most recent call last):
  File "youtube_dl/YoutubeDL.py", line 1022, in process_info
    success = dl(filename, info_dict)
  File "youtube_dl/YoutubeDL.py", line 998, in dl
    return fd.download(name, info)
  File "youtube_dl/downloader/common.py", line 291, in download
    return self.real_download(filename, info_dict)
  File "youtube_dl/downloader/http.py", line 58, in real_download
    data = self.ydl.urlopen(request)
  File "youtube_dl/YoutubeDL.py", line 1227, in urlopen
    return self._opener.open(req, timeout=self._socket_timeout)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 461, in open
    response = meth(req, response)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 571, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 499, in error
    return self._call_chain(*args)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 433, in _call_chain
    result = func(*args)
  File "/usr/local/Cellar/python3/3.4.1/Frameworks/Python.framework/Versions/3.4/lib/python3.4/urllib/request.py", line 579, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

The tests also fails on Travis, does it works for you?

@phihag
Copy link
Contributor

@phihag phihag commented Jul 20, 2014

You're right, the issue persists. Can somebody with flash player provide a correct set of before-and-after signatures?

@phihag phihag reopened this Jul 20, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 20, 2014

Before -> After
F375F75BF2AFDAAF2666E43868D46816F83F13E81C46.3725A8218E446A0DECD33F79DC282994D6AA92C92C9 -> 9C29AA6D499282CD97F33DCED0A644E8128A5273.64C18E31F38361864D86834E6662FAADFA2FB57F

1DF71F7C38F1610C44EF0BA5B0D27CF219A99508C6BC.9D48F1BC1594613E627C09A7BE3C5C828E705625625 -> 526507E828C5C3EB7A90C726E3164951CB1F84D9.CB6C80599A9D2FC72D0B5AB0FE44C0161F83C7F1
phihag added a commit that referenced this issue Jul 20, 2014
@phihag
Copy link
Contributor

@phihag phihag commented Jul 20, 2014

That's strange, our code outputs these already (added test in b6ea11b ).

@jaimeMF jaimeMF closed this in 2c57c7f Jul 20, 2014
@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Jul 20, 2014

It turns out that changing one of the parameters in the get_video_info url, gives the correct urls. So the swf interpreter is working fine (nice job!).

@phihag
Copy link
Contributor

@phihag phihag commented Jul 20, 2014

Excellent! Confirmed working with youtube-dl 2014.07.20.1 .

@Nurple
Copy link

@Nurple Nurple commented Jul 20, 2014

The problem still exists for me on Windows.

C:\Users\Nurple\Desktop>ydl --verbose "https://www.youtube.com/watch?v=PTFwQP86BRs"
[debug] System config: []
[debug] User config: ['--ignore-errors', '--title', '--no-overwrites', '--console-title']
[debug] Command-line args: ['--verbose', 'https://www.youtube.com/watch?v=PTFwQP86BRs']
[debug] Encodings: locale cp1252, fs mbcs, out cp850, pref cp1252
[debug] youtube-dl version 2014.07.20.1
[debug] Python version 2.7.5 - Windows-8-6.2.9200
[debug] Proxy map: {}
[youtube] Setting language
[youtube] PTFwQP86BRs: Downloading webpage
[youtube] PTFwQP86BRs: Downloading video info webpage
[youtube] Confirming age
[youtube] PTFwQP86BRs: Extracting video information
[youtube] encrypted signature length 88 (44.43), itag 43, flash player vflmDyk47
[youtube] PTFwQP86BRs: Downloading swf player vflmDyk47
ERROR: Automatic signature extraction failed: Traceback (most recent call last):
File "youtube_dl\extractor\youtube.pyo", line 472, in _decrypt_signature
File "youtube_dl\extractor\youtube.pyo", line 386, in _extract_signature_function
File "youtube_dl\extractor\youtube.pyo", line 454, in _parse_sig_swf
File "youtube_dl\swfinterp.pyo", line 154, in init
File "youtube_dl\swfinterp.pyo", line 153, in
File "youtube_dl\swfinterp.pyo", line 26, in _extract_tags
TypeError: Struct() argument 1 must be string, not unicode
; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.
Traceback (most recent call last):
File "youtube_dl\extractor\youtube.pyo", line 472, in _decrypt_signature
File "youtube_dl\extractor\youtube.pyo", line 386, in _extract_signature_function
File "youtube_dl\extractor\youtube.pyo", line 454, in _parse_sig_swf
File "youtube_dl\swfinterp.pyo", line 154, in init
File "youtube_dl\swfinterp.pyo", line 153, in
File "youtube_dl\swfinterp.pyo", line 26, in _extract_tags
TypeError: Struct() argument 1 must be string, not unicode
Traceback (most recent call last):
File "youtube_dl\YoutubeDL.pyo", line 516, in extract_info
File "youtube_dl\extractor\common.pyo", line 168, in extract
File "youtube_dl\extractor\youtube.pyo", line 848, in _real_extract
File "youtube_dl\extractor\youtube.pyo", line 482, in _decrypt_signature
ExtractorError: Automatic signature extraction failed: Traceback (most recent call last):
File "youtube_dl\extractor\youtube.pyo", line 472, in _decrypt_signature
File "youtube_dl\extractor\youtube.pyo", line 386, in _extract_signature_function
File "youtube_dl\extractor\youtube.pyo", line 454, in _parse_sig_swf
File "youtube_dl\swfinterp.pyo", line 154, in init
File "youtube_dl\swfinterp.pyo", line 153, in
File "youtube_dl\swfinterp.pyo", line 26, in _extract_tags
TypeError: Struct() argument 1 must be string, not unicode
; please report this issue on https://yt-dl.org/bug . Be sure to call youtube-dl with the --verbose flag and include its complete output. Make sure you are using the latest version; type youtube-dl -U to update.

phihag added a commit that referenced this issue Jul 20, 2014
@phihag
Copy link
Contributor

@phihag phihag commented Jul 20, 2014

@Nurple Your problem is completely unrelated, but I've tracked it down to an overly old Python version. Fixed in youtube-dl 2014.7.20.2.

@Nurple
Copy link

@Nurple Nurple commented Jul 20, 2014

Sorry about that, I thought it was related. Anyway thanks for the quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.