blackjack4494 / yt-dlc

media downloader and library for various sites.
The Unlicense
2.91k stars 368 forks source link

Could not find JS function on MacOSX Big Sur #319

Open inquisitivefrog opened 2 years ago

inquisitivefrog commented 2 years ago

Checklist

Verbose log

frog@My-MacBook-Pro wild_kratts % ../youtube-dlc -v 'https://www.youtube.com/watch?v=iyAefH3Bw1c'
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'-v', u'https://www.youtube.com/watch?v=iyAefH3Bw1c']
[debug] Loading archive file None
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dlc version 2020.11.11-3
[debug] Python version 2.7.16 (CPython) - Darwin-20.6.0-x86_64-i386-64bit
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] iyAefH3Bw1c: Downloading webpage
[youtube] {18} signature length 104, html5 player f3c4e04d
[youtube] iyAefH3Bw1c: Downloading player https://www.youtube.com/s/player/f3c4e04d/player_ias.vflset/en_US/base.js
ERROR: Signature extraction failed: Traceback (most recent call last):
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature
    video_id, player_url, s
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "../youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
 (caused by ExtractorError(u"Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.",)); please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature
    video_id, player_url, s
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "../youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
Traceback (most recent call last):
  File "../youtube-dlc/youtube_dlc/YoutubeDL.py", line 830, in extract_info
    ie_result = ie.extract(url)
  File "../youtube-dlc/youtube_dlc/extractor/common.py", line 532, in extract
    ie_result = self._real_extract(url)
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 2202, in _real_extract
    encrypted_sig, video_id, player_url, age_gate)
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1405, in _decrypt_signature
    'Signature extraction failed: ' + tb, cause=e)
ExtractorError: Signature extraction failed: Traceback (most recent call last):
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature
    video_id, player_url, s
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "../youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "../youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.
 (caused by ExtractorError(u"Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.",)); please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type  youtube-dlc -U  to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.

frog@My-MacBook-Pro wild_kratts % ../youtube-dlc --version
2020.11.11-3
tim@Tims-MacBook-Pro wild_kratts % sw_vers
ProductName:    macOS
ProductVersion: 11.6
BuildVersion:   20G165

Description

File failed to download due to Could Not find JS function error.

000011111111 commented 2 years ago

I am getting the same JS function error on macOS 12.1 youtube-dlc version 2020.11.11-3

######## Verbose bug info below

bash-3.2# youtube-dlc -x --audio-format mp3 https://youtu.be/UXUwLyX6sUg [youtube] UXUwLyX6sUg: Downloading webpage [youtube] UXUwLyX6sUg: Downloading js player f3c4e04d ERROR: Signature extraction failed: Traceback (most recent call last): File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature video_id, player_url, s File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function res = self._parse_sig_js(code) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js initial_function = jsi.extract_function(funcname) File "/usr/local/bin/youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function raise ExtractorError('Could not find JS function %r' % funcname) ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. (caused by ExtractorError(u"Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.",)); please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. bash-3.2# youtube-dlc -v -x --audio-format mp3 https://youtu.be/UXUwLyX6sUg [debug] System config: [] [debug] User config: [] [debug] Custom config: [] [debug] Command-line args: [u'-v', u'-x', u'--audio-format', u'mp3', u'https://youtu.be/UXUwLyX6sUg'] [debug] Loading archive file None [debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8 [debug] youtube-dlc version 2020.11.11-3 [debug] Python version 2.7.18 (CPython) - Darwin-21.2.0-arm64-arm-64bit [debug] exe versions: ffmpeg 4.3.2, ffprobe 4.3.2 [debug] Proxy map: {} [youtube] UXUwLyX6sUg: Downloading webpage [youtube] {18} signature length 104, html5 player f3c4e04d [youtube] UXUwLyX6sUg: Downloading player https://www.youtube.com/s/player/f3c4e04d/player_ias.vflset/en_US/base.js ERROR: Signature extraction failed: Traceback (most recent call last): File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature video_id, player_url, s File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function res = self._parse_sig_js(code) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js initial_function = jsi.extract_function(funcname) File "/usr/local/bin/youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function raise ExtractorError('Could not find JS function %r' % funcname) ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. (caused by ExtractorError(u"Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.",)); please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. Traceback (most recent call last): File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature video_id, player_url, s File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function res = self._parse_sig_js(code) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js initial_function = jsi.extract_function(funcname) File "/usr/local/bin/youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function raise ExtractorError('Could not find JS function %r' % funcname) ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. Traceback (most recent call last): File "/usr/local/bin/youtube-dlc/youtube_dlc/YoutubeDL.py", line 830, in extract_info ie_result = ie.extract(url) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/common.py", line 532, in extract ie_result = self._real_extract(url) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 2202, in _real_extract encrypted_sig, video_id, player_url, age_gate) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1405, in _decrypt_signature 'Signature extraction failed: ' + tb, cause=e) ExtractorError: Signature extraction failed: Traceback (most recent call last): File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1395, in _decrypt_signature video_id, player_url, s File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1295, in _extract_signature_function res = self._parse_sig_js(code) File "/usr/local/bin/youtube-dlc/youtube_dlc/extractor/youtube.py", line 1370, in _parse_sig_js initial_function = jsi.extract_function(funcname) File "/usr/local/bin/youtube-dlc/youtube_dlc/jsinterp.py", line 245, in extract_function raise ExtractorError('Could not find JS function %r' % funcname) ExtractorError: Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output. (caused by ExtractorError(u"Could not find JS function u'na'; please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.",)); please report this issue on https://github.com/blackjack4494/yt-dlc . Make sure you are using the latest version; type youtube-dlc -U to update. Be sure to call youtube-dlc with the --verbose flag and include its complete output.

bct@2021 bashScripts % sw_vers ProductName: macOS ProductVersion: 12.1 BuildVersion: 21C52

000011111111 commented 2 years ago

I switched to yt-dlp and got things working again.

Install and demo workflow linked here: https://youtu.be/dAc5VIDIs5k