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

Download Error "as no match could be found on youtube" #1039

Closed
cybermatthewhacking opened this issue Dec 16, 2020 · 45 comments
Closed

Download Error "as no match could be found on youtube" #1039

cybermatthewhacking opened this issue Dec 16, 2020 · 45 comments
Assignees
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed

Comments

@cybermatthewhacking
Copy link

cybermatthewhacking commented Dec 16, 2020

I'm having a problem when I download a song or playlist from spotify but I never had a problem with spotdl, I always use it and it works great for me (thanks to the developers for that).
I use the "spotdl" command with the playlist or song link. The following error appears on the console: "as no match could be found on youtube".
I hope you can solve it, maybe it is temporary or maybe because of the Google servers crash a few days ago that affected YouTube, however I download from Spotify.
Thank you very much to all!

**daredevil@Mateo-Fumis-PC:**/mnt/c/Users/Mateo/Documents/HACKING/Linux/spotify-downloader$ spotdl https://open.spotify.com/track/2rc7BkzO8qepMFAxHtOrXc
Fetching Song...
Skipping Blanco (https://open.spotify.com/track/2rc7BkzO8qepMFAxHtOrXc) as no match could be found on youtube
  0%|                                                 |ETA: ?, ~min/song
@cybermatthewhacking cybermatthewhacking added the Bug Unexpected problem or unintended behavior that needs to be fixed label Dec 16, 2020
@Silverarmor Silverarmor changed the title Download Error from Spotify: "as no match could be found on youtube" Download Error "as no match could be found on youtube" Dec 17, 2020
@Silverarmor
Copy link
Member

Can reproduce on spotDL v3.1.4 installed from master, and pytube 10.1.0

@ghost
Copy link

ghost commented Dec 18, 2020

might be fixed. try installing from master.zip

@HadeDevelopment
Copy link

I have this issue aswell. Reinstalled many times many different things.

@andrew-aiken
Copy link

Using the master.zip & latest install of ffmpeg
Windows 2004 (OS Build 19041.685)
ffmpeg version 2020-12-15-git-32586a42da-full_build-www.gyan.dev

@pihomeserver
Copy link

Same on Debian Linux 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

@vhavard
Copy link

vhavard commented Dec 21, 2020

Same issue on Anaconda install
Windows 10
spotdl 3.1.4
python 3.8.5
ffmpeg version git-2019-12-23-5b42d33

@Wahyukun1897
Copy link

i got the same problem as well

@Silverarmor
Copy link
Member

might be fixed. try installing from master.zip

Not fixed.

@Arcyno
Copy link

Arcyno commented Dec 23, 2020

here is the Traceback I get when trying to download playlist from master.zip :

Traceback (most recent call last):
  File "C:\Users\XXX\Anaconda3\Scripts\spotdl-script.py", line 33, in <module>
    sys.exit(load_entry_point('spotdl', 'console_scripts', 'spotdl')())
  File "e:\nosave\musique_dl\spotify-downloader-master\spotdl\__main__.py", line 113, in console_entry_point
    downloader.download_multiple_songs(songObjList)
  File "e:\nosave\musique_dl\spotify-downloader-master\spotdl\download\downloader.py", line 88, in download_multiple_songs
    self.downloadTracker.load_song_list(songObjList)
  File "e:\nosave\musique_dl\spotify-downloader-master\spotdl\download\progressHandlers.py", line 177, in load_song_list
    self.backup_to_disk()
  File "e:\nosave\musique_dl\spotify-downloader-master\spotdl\download\progressHandlers.py", line 196, in backup_to_disk
    remove(self.saveFile)
TypeError: remove: path should be string, bytes or os.PathLike, not NoneType
  0%|          |ETA: ?, ~min/song

@k0mat
Copy link
Contributor

k0mat commented Dec 23, 2020

I'm working on a fix on my fork(https://github.com/k0mat/spotify-downloader/) and will make PR when its finished. Although it's work in progress it should work on most songs and some playlists.

Instruction to use it:

uninstall old versions:
pip uninstall pytube
pip uninstall spotdl

install new versions:
python -m pip install git+https://github.com/nficano/pytube
pip install https://github.com/k0mat/spotify-downloader/archive/next-rel-dev.zip

@Silverarmor
Copy link
Member

@k0mat looks good! Can you open a draft PR so we can stay up to date? - Then mark as ready for review, when it's ready.

@MikhailZex can you add @k0mat to the joiners team?

@k0mat
Copy link
Contributor

k0mat commented Dec 23, 2020

@Silverarmor I've created and updated a PR(#1057). As of this PR spotdl does work correctly, I've succesfully downloaded a ~60 song playlist without errors. But there may be some edge cases when it doesn't, so some problems are to be expected, as usual.

One problem is that currently you have to manually install newest version of pytube python -m pip install git+https://github.com/nficano/pytube that is 10.1.0, 10.0.0 doesn't work

@andrew-aiken
Copy link

@k0mat Thanks for working on a solution for the problem.
I'm running into an error.

PS C:\Users\user\Music\MUSIC\New Music> spotdl https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA
  0%|                                                                                                |ETA: ?, ~min/songTraceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts\spotdl-script.py", line 33, in <module>
    sys.exit(load_entry_point('spotdl==3.2.0rc0', 'console_scripts', 'spotdl')())
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\spotdl\__main__.py", line 88, in console_entry_point
    downloader.download_single_song(song)
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 283, in download_single_song
    download_song(songObj, self.displayManager, self.downloadTracker)
, in download_song
    youtubeHandler = YouTube(
_
    self.prefetch()
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
    raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
  0%|                                                                                                |ETA: ?, ~min/song

@Silverarmor
Copy link
Member

@Mad-Chicken Put that on the PR #1057 please - It is unrelated to this issue.

@andrew-aiken
Copy link

Ok, was not sure if it was related.
#1058

@Silverarmor
Copy link
Member

@Mad-Chicken Post it as a comment on PR #1057.
DO NOT open an issue here for it.

@k0mat
Copy link
Contributor

k0mat commented Dec 24, 2020

@Mad-Chicken seems like you are not using the latest version of pytube. Try updating it with python -m pip install git+https://github.com/nficano/pytube

@outerepic
Copy link

outerepic commented Dec 25, 2020

I'm working on a fix on my fork(https://github.com/k0mat/spotify-downloader/) and will make PR when its finished. Although it's work in progress it should work on most songs and some playlists.

Instruction to use it:

uninstall old versions:
pip uninstall pytube
pip uninstall spotdl

install new versions:
python -m pip install git+https://github.com/nficano/pytube
pip install https://github.com/k0mat/spotify-downloader/archive/next-rel-dev.zip

Tried these 4 commands to get it working - I still get "path should be string, bytes or os.PathLike, not NoneType" from #1044 for playlists, for single tracks they are being skipped same as before

This is on python 3.9

@Silverarmor
Copy link
Member

@k0mat @Mad-Chicken @outerepic
Lets keep discussion about this fork on the PR (#1057) please. Avoid cluttering up this issue. Further comments about the PR/fork will be deleted for sake of keeping this issue easier to read.

@itismo
Copy link

itismo commented Dec 25, 2020

@k0mat Thanks for working on a solution for the problem.
I'm running into an error.

PS C:\Users\user\Music\MUSIC\New Music> spotdl https://open.spotify.com/track/08mG3Y1vljYA6bvDt4Wqkj?si=SxezdxmlTx-CaVoucHmrUA
  0%|                                                                                                |ETA: ?, ~min/songTraceback (most recent call last):
  File "C:\Users\user\AppData\Local\Programs\Python\Python39\Scripts\spotdl-script.py", line 33, in <module>
    sys.exit(load_entry_point('spotdl==3.2.0rc0', 'console_scripts', 'spotdl')())
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\spotdl\__main__.py", line 88, in console_entry_point
    downloader.download_single_song(song)
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\spotdl\download\downloader.py", line 283, in download_single_song
    download_song(songObj, self.displayManager, self.downloadTracker)
, in download_song
    youtubeHandler = YouTube(
_
    self.prefetch()
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "c:\users\user\appdata\local\programs\python\python39\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
    raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
  0%|                                                                                                |ETA: ?, ~min/song

I am running into the same error :(

@Arcyno
Copy link

Arcyno commented Dec 25, 2020

Working on my side!
good job :)

@itismo
Copy link

itismo commented Dec 29, 2020

Hello,

Just wanted to mention that the "could not find match for config_patterns" error was fixed in pytube 10.4.1 for me and now I can download normally 👍
Many thanks to the devs working on this!

python -m pip install git+https://github.com/nficano/pytube
pip show pytube
Name: pytube
Version: 10.4.1

@ZhouYii
Copy link

ZhouYii commented Jan 1, 2021

Hi everyone, still getting this issue due to a versioning related issue with pytube.

This install command installs pytube3 and not pytube. The pytube3 version from pypi and github is 9.6.4 which has the regex problem and some other problems once the regexes are ported from head.

pip3 install spotdl
...
Installing collected packages: pytube3
Successfully installed pytube3-9.6.4

How can I use pytube 10.x.x instead of pytube3 9.x.x for my spotdl invocations?
Thanks!

Update: I also tried installing from k0mat's branch which I thought contained a fix (replacing the search functions w/ YT music APIs). Seems like the following install still picks up pytube3-9.6.4

pip3 install https://github.com/k0mat/spotify-downloader/archive/next-rel-dev.zip

@Silverarmor
Copy link
Member

@ZhouYii did you even read any of the above comments? Multiple answer your question.

pip uninstall pytube
python -m pip install git+https://github.com/nficano/pytube
pip show pytube

@Silverarmor
Copy link
Member

I can still reproduce this error:
spotdl installed from master, 3.1.4, commit hash 162d7ce
pytube installed from master, 10.4.1
pip cache was cleared,

Issue staying open.

@mirenbz
Copy link

mirenbz commented Jan 4, 2021

I think @ZhouYii means that, even if you manually install pytube, spotdl (either the default version from pip or @k0mat 's version) actually is using pytube3, which is unaltered by the manual install of pytube and thus kept at v9.6.4. I'm having the same issue whatever I try, and am unable to download anything (playlists, albums or individual songs). Specifically:

With pip3 install spotdl and pip3 install https://github.com/spotDL/spotify-downloader/archive/v3.1.0.zip (which are probably the same thing), before and after uninstalling and manually installing pytube with pip3 install git+https://github.com/nficano/pytube:

  • playlist and album download attempts give error TypeError: remove: path should be string, bytes or os.PathLike, not NoneType
  • track download attempts give error Skipping . . . as no match could be found on youtube

With pip3 install https://github.com/spotDL/spotify-downloader/archive/master.zip, before and after uninstalling and manually installing pytube with pip3 install git+https://github.com/nficano/pytube:

  • playlist and album download attempts give error TypeError: cannot unpack non-iterable NoneType object
  • track download attempts give error Skipping . . . as no match could be found on youtube

With @k0mat's version, before and after uninstalling and manually installing pytube with pip3 install git+https://github.com/nficano/pytube:

  • playlist and album downloads fetch the track list, then get stuck at TypeError: __init__() missing 1 required positional argument: 'pattern' (or at least I get bored of waiting at that point)
  • track download attempts give error Skipping . . . as no match could be found on youtube

Also, both @k0mat 's version and v3.1.0 install (and thus use, I guess) pytube3 which, as I said, is unaffected by manual reinstall of pytube (pip3 show pytube gives v10.4.1, pip3 show pytube3 gives v9.6.4). Just installing spotdl with pip3 appears to use a-pytube-fork-for-spotdl-users v.9.6.4, so presumably also unaffected by manual reinstalls of pytube.

I'm probably not being of much help, just wanted to confirm that the error persists and I haven't been able to find a combination that works. If I'm leaving something out please let me know, and thanks to all the developers for your work.

@HazelNutzzz
Copy link

I also experienced all of that and search for thread for countless hours then I wonder if updating to python 3.9 will fix all of my problem. guess what? it fixed all of my problem

@mirenbz
Copy link

mirenbz commented Jan 4, 2021

OK, sorry for the n00b question... I have installed python 3.9 but how do I make it the default python to use? It's installed as python3.9 and python3 --version still says 3.8.5...

I have a faint memory of completely breaking my system the last time I uninstalled (some version of) python, so I'm not confident at all here!

@arryon
Copy link
Contributor

arryon commented Jan 5, 2021

Hi all, I wanted to chime in on this thread to resolve the issue with different pytube versions yielding an error on @k0mat 's fork of the repo that would otherwise work well. If the comment should be moved to his PR please let me know, but since there is already paper trail in this issue it looked like the correct place.

@mberasategi mentioned a few comments earlier:

I think @ZhouYii means that, even if you manually install pytube, spotdl (either the default version from pip or @k0mat 's version) actually is using pytube3, which is unaltered by the manual install of pytube and thus kept at v9.6.4. I'm having the same issue whatever I try, and am unable to download anything (playlists, albums or individual songs). Specifically:

I'm probably not being of much help, just wanted to confirm that the error persists and I haven't been able to find a combination that works. If I'm leaving something out please let me know, and thanks to all the developers for your work.

You were actually of great help :). I checked the site-packages location for a fresh Python install, and discovered that both pytube and pytube3 are installed under the same import name pytube. So they collide, probably causing the unpredictable behavior.
With that knowledge I was able to reproduce both the Regex error, and get a fix for it, using a fresh install in Miniconda (feel free to use your own flavor or re-use an existing env), by first installing the fork, and then overwriting the existing pytube3 install with the newest pytube version.

conda create -y -n spotdl python=3.8 && conda activate spotdl
pip install https://github.com/k0mat/spotify-downloader/archive/next-rel-dev.zip
pip uninstall pytube3 -y
python -m pip install git+https://github.com/nficano/pytube

I can confirm the correct pytube version is installed via python ~/<virtual env root folder>/envs/spotdl/lib/python3.8/site-packages/pytube/version/py which gives me 10.4.1

@Silverarmor
Copy link
Member

Fixed in v.3.2.1

@AlphaHasher
Copy link

Still experiencing this issue, I even tested on v.3.2.1 on the stable build, where it officially fixed and still no go.

@Silverarmor
Copy link
Member

@Codingboy65
image

@AlphaHasher
Copy link

I am in the US

@Silverarmor
Copy link
Member

@Codingboy65

  • Update to v3.3.3

@AlphaHasher
Copy link

image

This did not solve anything, same error, am I missing anything?

@Silverarmor
Copy link
Member

Please run spotdl https://open.spotify.com/track/0VjIjW4GlUZAMYd2vXMi3b?si=TNiemvONQviXQpWPSiR2Gw and show the exact output

@AlphaHasher
Copy link

image
Download worked!

@Silverarmor
Copy link
Member

Works fine then. If you get "as no match could be found on youtube", that literally tells you the issue

@AlphaHasher
Copy link

so spotdl does not work for all songs?

@Silverarmor
Copy link
Member

tCaTBTt

@AlphaHasher
Copy link

Yeah but if no match is found on YouTube is it supposed to then download it directly from Spotify, or is that not how it works?

@Silverarmor
Copy link
Member

Downloading from Spotify violates its TOS.
spotDL downloads from youtube if a match is found

@spotDL spotDL locked as off-topic and limited conversation to collaborators Mar 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed
Projects
None yet
Development

No branches or pull requests