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

Signature extraction failed: Traceback (most recent call last) #11663

Closed
linglung opened this issue Jan 10, 2017 · 22 comments
Closed

Signature extraction failed: Traceback (most recent call last) #11663

linglung opened this issue Jan 10, 2017 · 22 comments
Labels

Comments

@linglung
Copy link

linglung commented Jan 10, 2017

The title says about this issue.
Before creating this issue, i already search and read some issues related to mine, such as: #7413 , #10019 , #3255 , #4603 and similar issue in other places by Google search. Most of them said it's caused by out of date version of youtube-dl.

What i've done is like below:

  • uninstall and remove everything any previous youtube-dl on my machine
  • reinstall latest version through pip install --upgrade youtube-dl
  • Uninstall through pip, replace using latest build exe for windows

Same result. None of them are worked.

pip install --upgrade youtube-dl
Collecting youtube-dl
  Using cached youtube_dl-2017.1.8-py2.py3-none-any.whl
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2017.1.8
$ youtube-dl --version
2017.01.08
$ python --version
Python 3.6.0
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://www.youtube.com/watch?v=yKNxeF4KMsY', '-v']
[debug] Encodings: locale cp1252, fs utf-8, out cp1252, pref cp1252
[debug] youtube-dl version 2017.01.08
[debug] Python version 3.6.0 - Windows-10-10.0.14393-SP0
[debug] exe versions: ffmpeg 2.8.4, ffprobe N-82966-g6993bb4
[debug] Proxy map: {}
[youtube] yKNxeF4KMsY: Downloading webpage
[youtube] yKNxeF4KMsY: Downloading video info webpage
[youtube] yKNxeF4KMsY: Extracting video information
[youtube] {43} signature length 44.40, html5 player en_US-vflsagga9
[youtube] yKNxeF4KMsY: Downloading player https://s.ytimg.com/yts/jsbin/player-en_US-vflsagga9/base.js
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1005, in _decrypt_signature
    video_id, player_url, s
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 932, in _extract_signature_function
    cache_res = res(test_string)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 984, in <lambda>
    return lambda s: initial_function([s])
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 254, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 55, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 174, in interpret_expression
    return obj[member](argvals)
KeyError: 'qC'
 (caused by KeyError('qC',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1005, in _decrypt_signature
    video_id, player_url, s
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 932, in _extract_signature_function
    cache_res = res(test_string)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 984, in <lambda>
    return lambda s: initial_function([s])
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 254, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 55, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 174, in interpret_expression
    return obj[member](argvals)
KeyError: 'qC'
Traceback (most recent call last):
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1005, in _decrypt_signature
    video_id, player_url, s
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 932, in _extract_signature_function
    cache_res = res(test_string)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 984, in <lambda>
    return lambda s: initial_function([s])
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 254, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 55, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 174, in interpret_expression
    return obj[member](argvals)
KeyError: 'qC'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\YoutubeDL.py", line 694, in extract_info
    ie_result = ie.extract(url)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\common.py", line 359, in extract
    return self._real_extract(url)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1584, in _real_extract
    encrypted_sig, video_id, player_url, age_gate)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1015, in _decrypt_signature
    'Signature extraction failed: ' + tb, cause=e)
youtube_dl.utils.ExtractorError: Signature extraction failed: Traceback (most recent call last):
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 1005, in _decrypt_signature
    video_id, player_url, s
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 932, in _extract_signature_function
    cache_res = res(test_string)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\extractor\youtube.py", line 984, in <lambda>
    return lambda s: initial_function([s])
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 254, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 55, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "c:\users\google\appdata\local\programs\python\python36-32\lib\site-packages\youtube_dl\jsinterp.py", line 174, in interpret_expression
    return obj[member](argvals)
KeyError: 'qC'
 (caused by KeyError('qC',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@lolaristocrat
Copy link

also having this issue :(

@KitoHD
Copy link

KitoHD commented Jan 10, 2017

I'm having this issue too.

@linglung
Copy link
Author

Seem like youtube updated the layout, caused by something like this html5 player en_US-vflsagga9. 😢

@yan12125
Copy link
Collaborator

Can anyone run youtube-dl --write-pages yKNxeF4KMsY and upload all *.dump files?

@yan12125
Copy link
Collaborator

OK I got this bug, too

@yan12125 yan12125 added the bug label Jan 10, 2017
@linglung
Copy link
Author

linglung commented Jan 10, 2017

@yan12125 Still need to upload *.dump files or not? as i can't attach zip file here

@anovicecodemonkey
Copy link

@yan12125 Here's the *.dump files: https://www.sendspace.com/filegroup/JhlFwck9rTaglBTPq6nYRS88mETW2kvb

@Doinkle
Copy link

Doinkle commented Jan 10, 2017

Would just like to make it known that I am having this same issue.

@trongnguyentcec
Copy link

I've got the same issue.

@nmarley
Copy link

nmarley commented Jan 10, 2017

"I'm having the same issue" and "+1" comments are just creating noise at this point. It's a known issue, there will be a fix soon. Please consider this before posting here.

@yan12125
Copy link
Collaborator

yan12125 commented Jan 10, 2017

Here's an ad-hoc fix:

diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 335568a10..aaa8d2b0c 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -1267,6 +1267,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             # Try looking directly into the video webpage
             ytplayer_config = self._get_ytplayer_config(video_id, video_webpage)
             if ytplayer_config:
+                player_url = ytplayer_config.get('url')
                 args = ytplayer_config['args']
                 if args.get('url_encoded_fmt_stream_map'):
                     # Convert to the same format returned by compat_parse_qs
@@ -1552,7 +1553,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
                         jsplayer_url_json = self._search_regex(
                             ASSETS_RE, embed_webpage, 'JS player URL')
 
-                    player_url = json.loads(jsplayer_url_json)
+                    if player_url is None:
+                        player_url = json.loads(jsplayer_url_json)
                     if player_url is None:
                         player_url_json = self._search_regex(
                             r'ytplayer\.config.*?"url"\s*:\s*("[^"]+")',

Please upload dump files if this does not work for you.

@Kagami
Copy link
Contributor

Kagami commented Jan 10, 2017

@yan12125 works for me for a simple test. Thanks.

@Kagami
Copy link
Contributor

Kagami commented Jan 10, 2017

@yan12125 fails with trace for removed videos. E.g.:

$ youtube-dl -F atcXRlPT12o               
[youtube] atcXRlPT12o: Downloading webpage
Traceback (most recent call last):
  File "/usr/lib64/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib64/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/kagami/.local/bin/youtube-dl/__main__.py", line 19, in <module>
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/__init__.py", line 444, in main
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/__init__.py", line 434, in _real_main
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1791, in download
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 694, in extract_info
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/extractor/common.py", line 359, in extract
  File "/home/kagami/.local/bin/youtube-dl/youtube_dl/extractor/youtube.py", line 1275, in _real_extract
AttributeError: 'NoneType' object has no attribute 'get'

@yan12125
Copy link
Collaborator

@Kagami Hurry brings bad codes :-)

@dstftw
Copy link
Collaborator

dstftw commented Jan 10, 2017

Yet another hack:

Index: youtube_dl/jsinterp.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- youtube_dl/jsinterp.py	(date 1483978139000)
+++ youtube_dl/jsinterp.py	(revision )
@@ -213,7 +213,7 @@
     def extract_object(self, objname):
         obj = {}
         obj_m = re.search(
-            (r'(?:var\s+)?%s\s*=\s*\{' % re.escape(objname)) +
+            (r'(?<!this\.)%s\s*=\s*\{' % re.escape(objname)) +
             r'\s*(?P<fields>([a-zA-Z$0-9]+\s*:\s*function\(.*?\)\s*\{.*?\}(?:,\s*)?)*)' +
             r'\}\s*;',
             self.code)

@yan12125
Copy link
Collaborator

@dstftw Mind applying your patch to master? Although that's dirty, it's better than going back to the old Flash way.

@dstftw dstftw closed this as completed in d1aeacd Jan 10, 2017
@dstftw
Copy link
Collaborator

dstftw commented Jan 10, 2017

Done and released.

@yan12125
Copy link
Collaborator

Thanks!

@yan12125
Copy link
Collaborator

@KitoHD
Copy link

KitoHD commented Jan 10, 2017

how do i open the script panel thing, sorry im new to this. how do i fix this?

@yan12125
Copy link
Collaborator

@KitoHD How did you install youtube-dl?

@ytdl-org ytdl-org locked and limited conversation to collaborators Jan 10, 2017
@dstftw
Copy link
Collaborator

dstftw commented Jan 10, 2017

This issue is already fixed. Read this FAQ entry if you have troubles updating.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants