Spotify-downloader: Playlist Download error - TypeError: remove

Created on 17 Dec 2020  路  24Comments  路  Source: spotDL/spotify-downloader

Can't download playlist on current master e8e5c5c

starenka /tmp % spotdl 'https://open.spotify.com/playlist/1PXEFbd9hVUXj6K0mSG0zL?si=O12Y1xUhQ9qDAdwybg5onA' Fetching Playlist... Traceback (most recent call last): File "/home/starenka/.local/bin/spotdl", line 8, in <module> sys.exit(console_entry_point()) File "/home/starenka/.local/lib/python3.9/site-packages/spotdl/__main__.py", line 116, in console_entry_point downloader.download_multiple_songs(songObjList) File "/home/starenka/.local/lib/python3.9/site-packages/spotdl/download/downloader.py", line 288, in download_multiple_songs self.downloadTracker.load_song_list(songObjList) File "<string>", line 2, in load_song_list File "/usr/lib/python3.9/multiprocessing/managers.py", line 824, in _callmethod raise convert_to_error(kind, result) TypeError: remove: path should be string, bytes or os.PathLike, not NoneType

bug

Most helpful comment

@chhawkins2001 I have tested your commit and looks like you missed off a file.

import ytm ModuleNotFoundError: No module named 'ytm'

All 24 comments

I am getting the same results on both stable and latest version.
It was fine two weeks ago when I last used it. I just updated to latest Python 391 hoping it would fix it. It didn't.

This is happening on both previous 3.1.4 and current dev 3.2.0rc0

Fetching Playlist... Traceback (most recent call last): File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\__main__.py", line 131, in <module> console_entry_point() File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\__main__.py", line 113, in console_entry_point downloader.download_multiple_songs(songObjList) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\download\downloader.py", line 88, in download_multiple_songs self.downloadTracker.load_song_list(songObjList) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\download\progressHandlers.py", line 177, in load_song_list self.backup_to_disk() File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\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

Also getting an issue on an install w/ fresh install.

鈹斺攢$ spotdl https://open.spotify.com/album/2YMWspDGtbDgYULXvVQFM6?si=gF5dOQm8QUSo-NdZVsFjAQ                                                                                                                                           

#Fetching Album...                                                                                                                                                                                                                          
Traceback (most recent call last):
  File "/home/user/.local/bin/spotdl", line 8, in <module>
    sys.exit(console_entry_point())
  File "/home/user/.local/lib/python3.8/site-packages/spotdl/__main__.py", line 110, in console_entry_point
    downloader.download_multiple_songs(songObjList)
  File "/home/user/.local/lib/python3.8/site-packages/spotdl/download/downloader.py", line 288, in download_multiple_songs
    self.downloadTracker.load_song_list(songObjList)
  File "<string>", line 2, in load_song_list
  File "/usr/lib/python3.8/multiprocessing/managers.py", line 850, in _callmethod
    raise convert_to_error(kind, result)
TypeError: remove: path should be string, bytes or os.PathLike, not NoneType

Will look into it

I am getting the same results on both stable and latest version.
It was fine two weeks ago when I last used it. I just updated to latest Python 391 hoping it would fix it. It didn't.

This is happening on both previous 3.1.4 and current dev 3.2.0rc0

Fetching Playlist... Traceback (most recent call last): File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\__main__.py", line 131, in <module> console_entry_point() File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\__main__.py", line 113, in console_entry_point downloader.download_multiple_songs(songObjList) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\download\downloader.py", line 88, in download_multiple_songs self.downloadTracker.load_song_list(songObjList) File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\spotdl\download\progressHandlers.py", line 177, in load_song_list self.backup_to_disk() File "C:\Users\Maja\AppData\Local\Programs\Python\Python39\lib\site-packages\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

Dec version is still glitchy. Please keep to master

Same here. Tried downloading a playlist, and it threw the same error. Is there a way to revert back to the old usable version again?

As far as I know, the only thing you can do is a clean reinstall.

Uninstall SpotDL and it's dependencies. Clear your pip cache, install SpotDL with pip.

I have complete several fresh installations on different platforms (Windows & Linux) and it's still giving the same error msg.

Same here... there's no solution yet, right?

Bump.
Any news?

I think that I've found where the issue is. The __query_and_simplify() function in provider.py is not returning anything, no matter the input (from my tests)

When it didn't return anything for the whole set of queries (whether that was an album, playlist, or a single track), the code tried to delete the .spotdltrackingfile that didn't exist (hence the nonetype error)

Now, I'm not sure what all is supposed to be returned in the list from that function, but I found a possible api replacement at https://python-youtube-music.readthedocs.io/en/latest/ (on github at https://github.com/tombulled/python-youtube-music), it actually works to return a list of possible suggestions, although I find that it is lacking in the metadata department, so choosing a best fit may be harder if the algorithm relies on that.

I'll try to integrate it tonight and see what happens

Update: the ytm library works like a charm for getting a list of links, but it gives little to no metadata (not good) so I'm looking at the ytmusicapi library (https://ytmusicapi.readthedocs.io/en/latest/) because while I cannot get the search function to work, I can pass it a youtube video or song ID and get the metadata back (and formatted quite nicely for what we want it for, imo)

@chhawkins2001, we get a ton of metadata from Spotify - much more than YouTube can provide (a full 1 mb of it) the only reason we need YouTube music is to get a song match on YouTube.

Yea, I get that, but without the metadata from the second library, there would be no way to get an accurate match. There was no duration, artist, or correct album title, so we would be finding matches based on the title alone.

I think I have a working implementation, so once my computer stops hating me, I'll make a pull request and y'all can see my not-up-to-standards code haha

@chhawkins2001 I have tested your commit and looks like you missed off a file.

import ytm ModuleNotFoundError: No module named 'ytm'

ah, I see the issue

I forgot that ytm needs a seperate install because you can't just pip it directly from github, afaik

heres the link to it: https://github.com/tombulled/python-youtube-music

sorry about that!

I'm not sure how to implement that directly in the code, because I haven't had much experience with package dependencies on github, so if someone with more experience could help me out with that, I would be so thankful

Oh, and one last thing, I'm pretty sure you DO need the YouTubeMusicDL support

Fixed it without the need for a new dependency

Oh, nice!

One issue though...

While it works for the couple of the single tracks I tested, this album (https://open.spotify.com/album/3GmCXW10kLxmZrEY0JpRlw and I'm sure many others) does not work on your fix, while it does on mine, I'm not sure why, but no error is thrown, so I think that the underlying issue is still there, even though you fixed the obvious errors it was throwing

Edit: I redact my statement, it was a config that i had broken on accident and not reverted, great fix!

I'm a dummie when it comes to python and github. How can I get this fixed version?
pip install https://codeload.github.com/spotDL/spotify-downloader/zip/master seems to give me 3.1.4 with still the same error.

same thing happening to me. already did a clean install

C:\Users\HazelNutzzz>spotdl https://open.spotify.com/playlist/4AiDVlhewoN9ZraJO5pNQa
Fetching Playlist...
Traceback (most recent call last):
  File "C:\Users\HazelNutzzz\AppData\Local\Programs\Python\Python37-32\Scripts\spotdl-script.py", line 11, in <module>
    load_entry_point('spotdl==3.1.4', 'console_scripts', 'spotdl')()
  File "c:\users\hazelnutzzz\appdata\local\programs\python\python37-32\lib\site-packages\spotdl\__main__.py", line 113, in console_entry_point
    downloader.download_multiple_songs(songObjList)
  File "c:\users\hazelnutzzz\appdata\local\programs\python\python37-32\lib\site-packages\spotdl\download\downloader.py", line 88, in download_multiple_songs
    self.downloadTracker.load_song_list(songObjList)
  File "c:\users\hazelnutzzz\appdata\local\programs\python\python37-32\lib\site-packages\spotdl\download\progressHandlers.py", line 177, in load_song_list
    self.backup_to_disk()
  File "c:\users\hazelnutzzz\appdata\local\programs\python\python37-32\lib\site-packages\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

@pithuene 's branch fixes this error for me.

Figured out how to install branches. While @pithuene 's branch gave me KeyError: 'playNavigationEndpoint' straight away...
This made it at least search after each track but end up with TypeError: __init__() missing 1 required positional argument: 'pattern' after 11%.

Current spotDL master commit still gives me the first TypeError: Remove that this issue is based up on.

Figured out how to install branches. While @pithuene 's branch gave me KeyError: 'playNavigationEndpoint' straight away...
This made it at least search after each track but end up with TypeError: __init__() missing 1 required positional argument: 'pattern' after 11%.

Current spotDL master commit still gives me the first TypeError: Remove that this issue is based up on.

The KeyError: 'playNavigationEndpoint' issue was fixed in #1043 which is not yet present in my master branch. If you really want to install from my fork use the dev branch which currently contains fixes for #1044 #1038 and #995. However, this should only be a short term fix until #1064 is merged. I can't guarantee that the branch remains usable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jjboy91 picture jjboy91  路  5Comments

noahball picture noahball  路  3Comments

loftwah picture loftwah  路  5Comments

MangoTornado picture MangoTornado  路  6Comments

marinabar picture marinabar  路  4Comments