spotify2tidal / spotify_to_tidal

A command line tool for importing your Spotify playlists into Tidal
GNU Affero General Public License v3.0
241 stars 44 forks source link

AttributeError: 'UserPlaylist' object has no attribute 'requests'. #48

Closed Max-Pare closed 1 month ago

Max-Pare commented 1 month ago

The program works

Erasing existing tracks from Tidal playlist:   0%|                                                                                                                                                                                                             | 0/147 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "C:\Users\maste\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\maste\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\maste\AppData\Local\Programs\Python\Python310\Scripts\spotify_to_tidal.exe\__main__.py", line 7, in <module>
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\__main__.py", line 33, in main
    _sync.sync_list(spotify_session, tidal_session, _sync.get_user_playlist_mappings(spotify_session, tidal_session, config), config)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\sync.py", line 262, in sync_list
    repeat_on_request_error(sync_playlist, spotify_session, tidal_session, spotify_id, tidal_id, config)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\sync.py", line 129, in repeat_on_request_error
    return function(*args, **kwargs)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\sync.py", line 254, in sync_playlist
    set_tidal_playlist(tidal_playlist, tidal_track_ids)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\tidalapi_patch.py", line 26, in set_tidal_playlist
    clear_tidal_playlist(playlist)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\tidalapi_patch.py", line 13, in clear_tidal_playlist
    _remove_indices_from_playlist(playlist, indices)
  File "G:\Data\Coding\Python\__EXTERNAL__\spotify_to_tidal-main\src\spotify_to_tidal\tidalapi_patch.py", line 6, in _remove_indices_from_playlist
    playlist.requests.request('DELETE', (playlist._base_url + '/items/%s') % (playlist.id, index_string), headers=headers)
AttributeError: 'UserPlaylist' object has no attribute 'requests'. Did you mean: 'request'?
timrae commented 1 month ago

It sounds like you have the wrong version of the tidal api

timrae commented 1 month ago

Edit: Fixed now, please pull and re-install dependencies with python3 -m pip install -e . Thanks for reporting

Max-Pare commented 1 month ago

splendid, thank you very much.