Dealing with 404 error in spotify API - Python

Viewed 32

I'm working with a dataset that has 5000 Spotify albums, my goal is to get the features from all albums. I'm having the following problem: Some lines of the file return an error like the one below:


HTTP Error for GET to https://api.spotify.com/v1/search with Params: {'q': 'album:ニンテンドーDS ポケモン ダイヤモンド&パール スーパーミュージックコレクション (Nintendo DS Pokémon Diamond & Pearl Super Music Collection)', 'limit': 10, 'offset': 0, 'type': 'album', 'market': None} returned 404 due to Not found.

I'm searching for a "lazy" solution to this, there is some way to skip the error? I tried to use the except block:

for album_1 in all_albums:
    try:
        rows.append(merge_info(album_1))
    except:
        continue

But it doesn't work.

Any help is appreciated!

0 Answers
Related