caseychu / spotify-backup

A Python script that exports all of your Spotify playlists.
MIT License
847 stars 123 forks source link

Fixed crash when track missing all its info #30

Closed rikkus closed 3 years ago

rikkus commented 3 years ago

Spotify's API gave out a track that looked like this:

      {     
        "added_at": "2020-02-14T17:31:47Z",
        "added_by": {
          "external_urls": {
            "spotify": "https://open.spotify.com/user/"
          },    
          "href": "https://api.spotify.com/v1/users/",
          "id": "",
          "type": "user",
          "uri": "spotify:user:"
        },    
        "is_local": false,
        "primary_color": null, 
        "track": null, 
        "video_thumbnail": null
      },

As 'track' is null, the playlist save crashes when using tab-separated mode.

This change ignores tracks with 'null' info.

caseychu commented 3 years ago

Thanks for fixing this!