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

AttributeError exception to be catched #1

Open
nchiarappa opened this issue Feb 13, 2019 · 1 comment
Open

AttributeError exception to be catched #1

nchiarappa opened this issue Feb 13, 2019 · 1 comment

Comments

@nchiarappa
Copy link
Owner

When copying tidal playlists from one account to another one

Traceback (most recent call last):
File "script.py", line 417, in
copy_tidal_playlists_to_another_tidal_account()
File "script.py", line 163, in copy_tidal_playlists_to_another_tidal_account
tracks = tidal_session_2.get_playlist_tracks(playlist.id)
File "/home/nicola/.local/lib/python2.7/site-packages/tidalapi/init.py", line 113, in get_playlist_tracks
return self._map_request('playlists/%s/tracks' % playlist_id, ret='tracks')
File "/home/nicola/.local/lib/python2.7/site-packages/tidalapi/init.py", line 189, in _map_request
return list(map(parse, items))
File "/home/nicola/.local/lib/python2.7/site-packages/tidalapi/init.py", line 256, in _parse_track
album = _parse_album(json_obj['album'], artist)
File "/home/nicola/.local/lib/python2.7/site-packages/tidalapi/init.py", line 226, in _parse_album
kwargs['release_date'] = datetime.datetime(*map(int, json_obj['releaseDate'].split('-')))
AttributeError: 'NoneType' object has no attribute 'split'

In tidalapi only ValueError exception is handled (see https://pythonhosted.org/tidalapi/_modules/tidalapi.html#Session.get_playlist_tracks and related _parse_album method).

@nchiarappa
Copy link
Owner Author

Change
except (ValueError, AttributeError) as e:
pass
should be done in tidalapi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant