question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Signature extraction failed

See original GitHub issue

My script in python:

from __future__ import unicode_literals
import youtube_dl
import os
from sys import argv

# Download data and config

download_options = {
    'format': 'bestaudio/best',
    'outtmpl': '%(title)s.$(ext)s',
    'nocheckcertificate': True,
    'yesplaylist': True,
    'postprocessors': [{
        'key': 'FFmpegExtractAudio',
        'preferredcodec': 'mp3',
        'preferredquality': '192',
    }],
}

# Songs folder
if not os.path.exists('Songs'):
    os.mkdir('Songs')
else:
    os.chdir('Songs')

# Download media
with youtube_dl.YoutubeDL(download_options) as dl:
    with open('../' + argv[1], 'r') as f:
        for song_url in f:
            dl.download([song_url])

The output:

[youtube:playlist] PLF-qa2XynaCU5lkOV4w7j6llxHvqQrW0n: Downloading webpage
[download] Downloading playlist: Music
[youtube:playlist] playlist Music: Downloading 12 videos
[download] Downloading video 1 of 12
[youtube] nzKOLBzdwM0: Downloading webpage
[youtube] nzKOLBzdwM0: Downloading video info webpage
[youtube] nzKOLBzdwM0: Downloading js player vflbDJ8ds
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1380, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1293, in _extract_signature_function
    cache_res = res(test_string)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1356, in <lambda>
    return lambda s: initial_function([s])
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 258, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 92, in interpret_expression
    m.group('expr'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 189, in interpret_expression
    m.group('x'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 211, in interpret_expression
    raise ExtractorError('Unsupported JS expression %r' % expr)
youtube_dl.utils.ExtractorError: Unsupported JS expression '[1999057972,'; 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.
 (caused by ExtractorError("Unsupported JS expression '[1999057972,'; 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.")); 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 "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1380, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1293, in _extract_signature_function
    cache_res = res(test_string)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1356, in <lambda>
    return lambda s: initial_function([s])
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 258, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 92, in interpret_expression
    m.group('expr'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 189, in interpret_expression
    m.group('x'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 211, in interpret_expression
    raise ExtractorError('Unsupported JS expression %r' % expr)
youtube_dl.utils.ExtractorError: Unsupported JS expression '[1999057972,'; 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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 796, in extract_info
    ie_result = ie.extract(url)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 530, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 2043, in _real_extract
    encrypted_sig, video_id, player_url, age_gate)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1390, in _decrypt_signature
    'Signature extraction failed: ' + tb, cause=e)
youtube_dl.utils.ExtractorError: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1380, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1293, in _extract_signature_function
    cache_res = res(test_string)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1356, in <lambda>
    return lambda s: initial_function([s])
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 258, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 92, in interpret_expression
    m.group('expr'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 189, in interpret_expression
    m.group('x'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 211, in interpret_expression
    raise ExtractorError('Unsupported JS expression %r' % expr)
youtube_dl.utils.ExtractorError: Unsupported JS expression '[1999057972,'; 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.
 (caused by ExtractorError("Unsupported JS expression '[1999057972,'; 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.")); 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.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "downloader.py", line 30, in <module>
    dl.download([song_url])
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 2018, in download
    url, force_generic_extractor=self.params.get('force_generic_extractor', False))
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 807, in extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 1007, in process_ie_result
    extra_info=extra)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 869, in process_ie_result
    extra_info=extra_info)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 819, in extract_info
    self.report_error(compat_str(e), e.format_traceback())
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 624, in report_error
    self.trouble(error_message, tb)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 594, in trouble
    raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1380, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1293, in _extract_signature_function
    cache_res = res(test_string)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1356, in <lambda>
    return lambda s: initial_function([s])
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 258, in resf
    res, abort = self.interpret_statement(stmt, local_vars)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 92, in interpret_expression
    m.group('expr'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 189, in interpret_expression
    m.group('x'), local_vars, allow_recursion - 1)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 56, in interpret_statement
    v = self.interpret_expression(expr, local_vars, allow_recursion)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 211, in interpret_expression
    raise ExtractorError('Unsupported JS expression %r' % expr)
youtube_dl.utils.ExtractorError: Unsupported JS expression '[1999057972,'; 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.
 (caused by ExtractorError("Unsupported JS expression '[1999057972,'; 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.")); 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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
hersoncruzcommented, Jan 29, 2020

My bad, had to upgrade python package as well:

➜  pip3 uninstall youtube-dl
Uninstalling youtube-dl-2019.10.22:
  Would remove:
    /usr/local/bin/youtube-dl
    /usr/local/etc/bash_completion.d/youtube-dl.bash-completion
    /usr/local/etc/fish/completions/youtube-dl.fish
    /usr/local/lib/python3.7/site-packages/youtube_dl-2019.10.22.dist-info/*
    /usr/local/lib/python3.7/site-packages/youtube_dl/*
    /usr/local/share/doc/youtube_dl/README.txt
    /usr/local/share/man/man1/youtube-dl.1
Proceed (y/n)? y   
  Successfully uninstalled youtube-dl-2019.10.22

➜  pip3 install youtube-dl  
Collecting youtube-dl
  Downloading https://files.pythonhosted.org/packages/05/d4/64dfe51be0fae772e86be3c83d82ec22d59aa8521d8834e10355bf60f9f5/youtube_dl-2020.1.24-py2.py3-none-any.whl (1.8MB)
     |████████████████████████████████| 1.8MB 1.3MB/s 
Installing collected packages: youtube-dl
Successfully installed youtube-dl-2020.1.24
1reaction
mineiroPTcommented, Jan 29, 2020

Probably related to this: https://github.com/ytdl-org/youtube-dl/issues/23819

make sure you have the last version from 2020-01-24

Read more comments on GitHub >

github_iconTop Results From Across the Web

Signature extraction failed: Traceback (most recent call last ...
Make sure you are using the latest version; type youtube-dl -U to update. Be sure to call youtube-dl with the --verbose flag and...
Read more >
Signature extraction failed: Traceback (most recent call last)
Hi Guys, I'm on MAC osMojave 10.14.6. I tried to download a youtube video but got this error: ### [youtube] WqzTRK5GPWQ: Downloading ...
Read more >
youtube-dl failed to extract signature - Ask Ubuntu
A message is seen and it stopped working, which is following. ERROR: Signature extraction failed: Traceback (most recent call last): File "/usr/lib/python2.7/ ...
Read more >
1722934 – ERROR: Signature extraction failed
Description of problem: youtube-dl fails to download from some URL's. Version-Release number of selected component (if applicable): ...
Read more >
[SOLVED] youtube-dl can't download YT video - Devuan Forum
ExtractorError : Signature extraction failed: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/youtube_dl/extractor/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found