Skip to content

Commit

Permalink
Fix default search unavailable song edge (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigma67 committed Jan 28, 2021
1 parent e89adce commit 2857e22
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ytmusicapi/parsers/browsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def parse_search_results(self, results, resultType=None):
runs = get_flex_column_item(data, 1)['text']['runs']
last_artist_index = get_last_artist_index(runs)

if not search_result['videoId'] and default_offset: # unavailable song in default search edge case
default_offset = 0

search_result['artists'] = parse_song_artists_runs(
runs[default_offset:last_artist_index + 1])

Expand Down

0 comments on commit 2857e22

Please sign in to comment.