TypeError: list indices must be integers or slices, not str
Hello,
While running a loop with syncedlyrics.search(), I sometimes face the following issue:
lrc = syncedlyrics.search("Synthetic Dream lextrical", allow_plain_format=True) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/anaconda3/lib/python3.11/site-packages/syncedlyrics/__init__.py", line 59, in search _l = provider.get_lrc(search_term) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/anaconda3/lib/python3.11/site-packages/syncedlyrics/providers/musixmatch.py", line 120, in get_lrc tracks = body["track_list"] ~~~~^^^^^^^^^^^^^^ TypeError: list indices must be integers or slices, not str
my code:
for index, row in combined_data.iterrows():
song = row['combined']
lyrics = syncedlyrics.search(song, allow_plain_format=True)
data.at[index, 'lyrics'] = lyrics
What partially helped me was time.sleep(180) after each error and retrying the same values before skipping, yet it does not always work.