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

Playlist Download error - TypeError: remove #1044

Closed
starenka opened this issue Dec 17, 2020 · 24 comments · Fixed by #1064
Closed

Playlist Download error - TypeError: remove #1044

starenka opened this issue Dec 17, 2020 · 24 comments · Fixed by #1064
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed

Comments

@starenka
Copy link

starenka commented Dec 17, 2020

Can't download playlist on current master e8e5c5c

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```



@starenka starenka added the Bug Unexpected problem or unintended behavior that needs to be fixed label Dec 17, 2020
@Silverarmor Silverarmor changed the title Place a descriptive title here. Do not copy paste the error. Playlist Download error - TypeError: remove Dec 17, 2020
@Maja-dev
Copy link

Maja-dev commented Dec 17, 2020

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

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```


@andrew-aiken
Copy link

andrew-aiken commented Dec 17, 2020

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

@ghost
Copy link

ghost commented Dec 19, 2020

Will look into it

@ghost
Copy link

ghost commented Dec 19, 2020

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

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

@Vaarelsauce
Copy link

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?

@ghost
Copy link

ghost commented Dec 20, 2020

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.

@andrew-aiken
Copy link

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

@mirenbz
Copy link

mirenbz commented Dec 21, 2020

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

@wmorgue
Copy link

wmorgue commented Dec 25, 2020

Bump.
Any news?

@chhawkins2001
Copy link

chhawkins2001 commented Dec 28, 2020

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

@chhawkins2001
Copy link

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)

@ghost
Copy link

ghost commented Dec 29, 2020

@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.

@chhawkins2001
Copy link

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 added a commit to chhawkins2001/spotify-downloader that referenced this issue Dec 29, 2020
@terrorhawks
Copy link

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

import ytm ModuleNotFoundError: No module named 'ytm'

@chhawkins2001
Copy link

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!

@chhawkins2001
Copy link

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

@chhawkins2001
Copy link

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

pithuene added a commit to pithuene/spotify-downloader that referenced this issue Dec 30, 2020
Updates the expected return value of the YTM query.
@pithuene
Copy link
Contributor

Fixed it without the need for a new dependency

@chhawkins2001
Copy link

chhawkins2001 commented Dec 30, 2020

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!

pithuene added a commit to pithuene/spotify-downloader that referenced this issue Dec 30, 2020
Updates the expected return value of the YTM query.
@Maja-dev
Copy link

Maja-dev commented Jan 1, 2021

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.

@Silverarmor Silverarmor linked a pull request Jan 2, 2021 that will close this issue
@HazelNutzzz
Copy link

HazelNutzzz commented Jan 2, 2021

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

@asda488
Copy link

asda488 commented Jan 4, 2021

@pithuene 's branch fixes this error for me.

@Maja-dev
Copy link

Maja-dev commented Jan 5, 2021

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.

@pithuene
Copy link
Contributor

pithuene commented Jan 5, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Unexpected problem or unintended behavior that needs to be fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.