From 2857e2206741e747b834aef53fd5c09932adb6e0 Mon Sep 17 00:00:00 2001 From: sigma67 Date: Thu, 28 Jan 2021 22:11:47 +0100 Subject: [PATCH] Fix default search unavailable song edge (#161) --- ytmusicapi/parsers/browsing.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ytmusicapi/parsers/browsing.py b/ytmusicapi/parsers/browsing.py index 2944f342..423dbfc5 100644 --- a/ytmusicapi/parsers/browsing.py +++ b/ytmusicapi/parsers/browsing.py @@ -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])