From ee6c7fbb826dcbd99d5a75c49fde3a55bee43014 Mon Sep 17 00:00:00 2001 From: Kurt <38019652+iiKurt@users.noreply.github.com> Date: Mon, 28 Oct 2024 05:10:46 +1300 Subject: [PATCH] fix lyrics search (#236) --- lyricsgenius/genius.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lyricsgenius/genius.py b/lyricsgenius/genius.py index 183355c..b9e6641 100644 --- a/lyricsgenius/genius.py +++ b/lyricsgenius/genius.py @@ -208,10 +208,10 @@ def _get_item_from_search_response(self, response, search_term, type_, result_ty sections = sorted(response['sections'], key=lambda sect: sect['type'] == type_) - hits = [hit for hit in top_hits if hit['type'] == type_] + hits = [hit for hit in top_hits if hit['index'] == type_] hits.extend([hit for section in sections for hit in section['hits'] - if hit['type'] == type_]) + if hit['index'] == type_]) for hit in hits: item = hit['result']