Spotify-downloader: Issues with youtube-dl even after trying update instructions in FAQ

Created on 26 Jan 2019  ยท  13Comments  ยท  Source: spotDL/spotify-downloader

What is the purpose of your issue?

  • [X] Bug
  • [ ] Feature Request
  • [ ] Question
  • [ ] Other

I had this issue:
https://github.com/ritiek/spotify-downloader/issues/485

I referred to these:
https://github.com/ritiek/spotify-downloader/issues/484
https://github.com/ritiek/spotify-downloader/issues/488

And tried this:
https://github.com/ritiek/spotify-downloader/wiki/FAQ#i-get-this-youtube-dl-error-all-of-a-sudden

It seemed to have a problem but ended up saying it was correctly installed the 2nd time I ran:

โžœ  ~ pip3 install youtube-dl -U
Collecting youtube-dl
  Downloading https://files.pythonhosted.org/packages/a4/18/4839e0d7f1d1d7be081e8f9a423b60bba3d7da77b18ea7c58d9a48abe4fd/youtube_dl-2019.1.24-py2.py3-none-any.whl (1.8MB)
    100% |โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 1.8MB 8.2MB/s 
Installing collected packages: youtube-dl
  Found existing installation: youtube-dl 2018.11.18
    Uninstalling youtube-dl-2018.11.18:
      Successfully uninstalled youtube-dl-2018.11.18
  Rolling back uninstall of youtube-dl
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/etc/fish/completions/youtube-dl.fish'
Consider using the `--user` option or check the permissions.

โžœ  ~ pip3 install youtube-dl --user
Requirement already satisfied: youtube-dl in /usr/local/lib/python3.7/site-packages (2019.1.24)


Hoping the issue was now fixed, I tried running again but still the same issue:

โžœ  ~ spotdl --list january-s.txt --overwrite skip
INFO: Checking and removing any duplicate tracks
INFO: Preparing to download 41 songs

ERROR: Signature extraction failed: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1225, in _decrypt_signature
    video_id, player_url, s
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
    res = self._parse_sig_js(code)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
    initial_function = jsi.extract_function(funcname)
  File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
    raise ExtractorError('Could not find JS function %r' % funcname)
youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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("Could not find JS function 'encodeURIComponent'; 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.
ERROR: ERROR: Signature extraction failed: Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1225, in _decrypt_signature
        video_id, player_url, s
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
        res = self._parse_sig_js(code)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
        initial_function = jsi.extract_function(funcname)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
        raise ExtractorError('Could not find JS function %r' % funcname)
    youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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("Could not find JS function 'encodeURIComponent'; 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 1225, in _decrypt_signature
        video_id, player_url, s
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
        res = self._parse_sig_js(code)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
        initial_function = jsi.extract_function(funcname)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
        raise ExtractorError('Could not find JS function %r' % funcname)
    youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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 792, in extract_info
        ie_result = ie.extract(url)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/common.py", line 508, in extract
        ie_result = self._real_extract(url)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1837, 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 1235, 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 1225, in _decrypt_signature
        video_id, player_url, s
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
        res = self._parse_sig_js(code)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
        initial_function = jsi.extract_function(funcname)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
        raise ExtractorError('Could not find JS function %r' % funcname)
    youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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("Could not find JS function 'encodeURIComponent'; 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 "/usr/local/lib/python3.7/site-packages/pafy/backend_youtube_dl.py", line 38, in _fetch_basic
        self._ydl_info = ydl.extract_info(self.videoid, download=False)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 815, 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 620, in report_error
        self.trouble(error_message, tb)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/YoutubeDL.py", line 590, 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 1225, in _decrypt_signature
        video_id, player_url, s
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
        res = self._parse_sig_js(code)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
        initial_function = jsi.extract_function(funcname)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
        raise ExtractorError('Could not find JS function %r' % funcname)
    youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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("Could not find JS function 'encodeURIComponent'; 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 "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 95, in download_list
        download_single(raw_song, number=number)
      File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 130, in download_single
        content, meta_tags = youtube_tools.match_video_and_metadata(raw_song)
      File "/usr/local/lib/python3.7/site-packages/spotdl/youtube_tools.py", line 57, in match_video_and_metadata
        content = go_pafy(track, meta_tags)
      File "/usr/local/lib/python3.7/site-packages/spotdl/youtube_tools.py", line 36, in go_pafy
        track_info = pafy.new(track_url)
      File "/usr/local/lib/python3.7/site-packages/pafy/pafy.py", line 124, in new
        return Pafy(url, basic, gdata, size, callback, ydl_opts)
      File "/usr/local/lib/python3.7/site-packages/pafy/backend_youtube_dl.py", line 29, in __init__
        super(YtdlPafy, self).__init__(*args, **kwargs)
      File "/usr/local/lib/python3.7/site-packages/pafy/backend_shared.py", line 96, in __init__
        self._fetch_basic()
      File "/usr/local/lib/python3.7/site-packages/pafy/backend_youtube_dl.py", line 41, in _fetch_basic
        raise IOError(str(e).replace('YouTube said', 'Youtube says'))
    OSError: ERROR: Signature extraction failed: Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1225, in _decrypt_signature
        video_id, player_url, s
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1133, in _extract_signature_function
        res = self._parse_sig_js(code)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/extractor/youtube.py", line 1200, in _parse_sig_js
        initial_function = jsi.extract_function(funcname)
      File "/usr/local/lib/python3.7/site-packages/youtube_dl/jsinterp.py", line 245, in extract_function
        raise ExtractorError('Could not find JS function %r' % funcname)
    youtube_dl.utils.ExtractorError: Could not find JS function 'encodeURIComponent'; 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("Could not find JS function 'encodeURIComponent'; 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.
WARNING: Failed to download song. Will retry after other songs

So now I'm confused - not sure if the youtube-dl package was updated or not?

Any suggestions?

Most helpful comment

Try both upgrading and installing it for the current user:

$ pip3 install youtube-dl -U --user

Does this work?

All 13 comments

Try both upgrading and installing it for the current user:

$ pip3 install youtube-dl -U --user

Does this work?

No dice :\ @ritiek

I think you have multiple versions of youtube-dl installed in different paths, and the older one gets picked up when running spotdl. Let's try uninstalling all of them and re-install it only for the current user.

Uninstall them using:

$ pip3 uninstall youtube-dl
$ sudo pip3 uninstal youtube-dl

Run the above commands multiple times until it starts complaining about youtube-dl dependency not found.

Then re-install for the current user using:

$ pip3 install youtube-dl -U --user

See if this helps.

Thanks for the tip! That sort of worked.

A few songs downloaded successfully but others gave this error:

ERROR: _warn() takes 2 positional arguments but 5 were given
    Traceback (most recent call last):
      File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 95, in download_list
        download_single(raw_song, number=number)
      File "/usr/local/lib/python3.7/site-packages/spotdl/spotdl.py", line 130, in download_single
        content, meta_tags = youtube_tools.match_video_and_metadata(raw_song)
      File "/usr/local/lib/python3.7/site-packages/spotdl/youtube_tools.py", line 55, in match_video_and_metadata
        meta_tags = spotify_tools.generate_metadata(track)
      File "/usr/local/lib/python3.7/site-packages/spotdl/spotify_tools.py", line 41, in generate_metadata
        meta_tags = spotify.track(raw_song)
      File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 222, in track
        trid = self._get_id('track', track_id)
      File "/usr/local/lib/python3.7/site-packages/spotipy/client.py", line 850, in _get_id
        type, fields[-2], id)
    TypeError: _warn() takes 2 positional arguments but 5 were given
WARNING: Failed to download song. Will retry after other songs

Any ideas? @ritiek

Apparently, this seems like a bug with spotipy but I'll take a look just to be sure and maybe we could workaround this.

Regarding

ERROR: _warn() takes 2 positional arguments but 5 were given

See https://github.com/ritiek/spotify-downloader/issues/446#issuecomment-448359166 and https://github.com/ritiek/spotify-downloader/issues/446#issuecomment-458242947.

which might or might not solve the problem. As stated there, the line numbers in your traceback are vastly different from the line numbers in the current spotipy code on GitHub.

hey @ritiek @linusg, thanks for those tips. Just wondering if you guys had any updates on this?

Worked on trying to figure this out for a while just now but still stuck.
All packages seem to be up to date. Not sure what else to try at this point.

Is it working just fine for you guys? Maybe I should just blast and re-install everything?

Update:
1) I tried spotdl on a different playlist (let's call it Playlist A) and it ran perfectly on 99% of the songs
2) I was surprised, so I thought maybe the original errors ERROR: _warn() takes 2 positional arguments but 5 were given were associated with that playlist, let's call it Playlist B
3) I grabbed all the songs from Playlist B, created a new Spotify playlist, Playlist C, and ran spotdl on it
4) Did not get that ERROR: _warn() takes 2 positional arguments but 5 were given error anymore, even though it was all the same songs

Not sure what that means but hey - it's progress!

Is it working just fine for you guys?

Yep, fine at least on my side. I haven't been able to reproduce any such errors.

  1. I thought maybe the original errors ERROR: _warn() takes 2 positional arguments but 5 were given were associated with that playlist, let's call it Playlist B

That's weird, I have no idea why that happens. By any chance could you provide a link to playlist causing this error? Maybe I could take a look myself.

Yep, fine at least on my side. I haven't been able to reproduce any such errors.

Same here. Still works fine as always.

$ spotdl -V
spotdl 1.1.2
$ pip freeze | grep spotipy                    
spotipy==2.4.4

I think I have the solution.
I was getting the same error, but on trying to uninstall youtube_dl completely I finded an error. Debugging this error, I realized that youtube-dl was installed by "apt-get"
So check if youtube_dl is installed by the package manager of your system, if it is please uninstall by issuing something like
apt remove youtube-dl
and install the version from pip's repository.

Also sorry for my english, Thanks!!

I think you have multiple versions of youtube-dl installed in different paths, and the older one gets picked up when running spotdl. Let's try uninstalling all of them and re-install it only for the current user.

Uninstall them using:

$ pip3 uninstall youtube-dl
$ sudo pip3 uninstal youtube-dl

Run the above commands multiple times until it starts complaining about youtube-dl dependency not found.

Then re-install for the current user using:

$ pip3 install youtube-dl -U --user

See if this helps.

This solved it for me. Cheers.

YouTube-dl no longer a dependency.

I know it's late, just clearing out old issues.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mvrck19 picture mvrck19  ยท  5Comments

linusg picture linusg  ยท  6Comments

jjboy91 picture jjboy91  ยท  5Comments

mugi789 picture mugi789  ยท  3Comments

EsmailELBoBDev2 picture EsmailELBoBDev2  ยท  5Comments