mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 11:32:30 +01:00
Add error handling for invalid Deezer track_id
This commit is contained in:
parent
a4bde2af8b
commit
ef8a780e1c
1 changed files with 4 additions and 0 deletions
|
|
@ -192,6 +192,10 @@ class DeezerPlugin(MetadataSourcePlugin, BeetsPlugin):
|
|||
if deezer_id is None:
|
||||
return None
|
||||
track_data = requests.get(self.track_url + deezer_id).json()
|
||||
if 'error' in track_data:
|
||||
self._log.debug(f"Error fetching track {track_id}: "
|
||||
f"{track_data['error']['message']}")
|
||||
return None
|
||||
track = self._get_track(track_data)
|
||||
|
||||
# Get album's tracks to set `track.index` (position on the entire
|
||||
|
|
|
|||
Loading…
Reference in a new issue