Skip to content

Commit

Permalink
Skip song if track is empty.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasper Hartog committed Feb 7, 2021
1 parent 33fa58f commit c377d06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spotdl/search/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def get_playlist_tracks(playlistUrl: str) -> List[SongObj]:
while True:

for songEntry in playlistResponse['items']:
if songEntry['track'] is None:
continue

song = SongObj.from_url(
'https://open.spotify.com/track/' + songEntry['track']['id'])

Expand All @@ -92,7 +95,7 @@ def get_playlist_tracks(playlistUrl: str) -> List[SongObj]:
if playlistResponse['next']:
playlistResponse = spotifyClient.playlist_tracks(
playlistUrl,
offset=len(playlistTracks)
offset = playlistResponse['offset'] + playlistResponse['limit']
)
else:
break
Expand Down

0 comments on commit c377d06

Please sign in to comment.