Closed snowl closed 7 years ago
Trying to migrate a lot of playlists and I was seeing this on a few, breaking the whole process part way through. I did a little investigation.
The initial exception was raised from spotify.py, lin 14:
if "artists" in self.sp_track['track']:
...where self.sp_track['track'] is None.
This SpotifyQuery object is created from app.py, line 159:
query = SpotifyQuery(i, sp_playlist_uri, sp_track, track_count)
...where sp_track['track'] is None.
Since sp_track at this point comes from enumerate(sp_playlist_tracks)
, I added a little check in here to dump the data:
if sp_track['track'] is None:
raise Exception("None track in playlist:\n{0}".format(sp_playlist_tracks))
That data contains a track like this:
[
...
{
'added_by': None,
'track': None,
'is_local': None,
'added_at': None
},
...
]
I wondered if this was a completely fake track inserted in here, or a track that exists that we're missing the data for. So I checked:
So this just appears to just be a weird fake item inserted in between, and I figure I can safely ignore it. I've ended up skipping these by adding this at app.py, line 159:
if sp_track['track'] is not None:
... and indenting the following 3 lines of course to nest them in that check.
This resolves the issue for me. If I get a little more time later I will submit a patch for it.
Hi rckclmbr, I'm trying to use pyportify to copy my music to GPM. I found pyportify but when I try and use it on my main playlist (https://open.spotify.com/user/1112911680/playlist/4Uqi6PgbGU69RkzGLcYtQM) this is the error I get:
Thanks, Snowl