sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
791 stars 65 forks source link

List index out of range for some playlists #12

Closed vincentjames501 closed 3 years ago

vincentjames501 commented 3 years ago

Example playlist below. I may try to dig into it a bit later but I've only had two fail so no big deal. Thanks for this tool!

requested from 100
requested from 200
requested from 300
10 searched
20 searched
30 searched
40 searched
50 searched
60 searched
70 searched
80 searched
90 searched
100 searched
110 searched
120 searched
130 searched
140 searched
150 searched
Traceback (most recent call last):
  File "/Users/vincent/Documents/Personal/spotifyplaylist_to_ytmusic/YouTube.py", line 190, in <module>
    main()
  File "/Users/vincent/Documents/Personal/spotifyplaylist_to_ytmusic/YouTube.py", line 181, in main
    videoIds = ytmusic.search_songs(playlist['tracks'])
  File "/Users/vincent/Documents/Personal/spotifyplaylist_to_ytmusic/YouTube.py", line 70, in search_songs
    result = self.api.search(query, ignore_spelling=True)
  File "/usr/local/lib/python3.9/site-packages/ytmusicapi/mixins/browsing.py", line 176, in search
    search_results.extend(self.parser.parse_search_results(results, type))
  File "/usr/local/lib/python3.9/site-packages/ytmusicapi/helpers.py", line 83, in _impl
    return method(self, *method_args, **method_kwargs)
  File "/usr/local/lib/python3.9/site-packages/ytmusicapi/parsers/browsing.py", line 46, in parse_search_results
    search_result['itemCount'] = get_item_text(data, 1,
  File "/usr/local/lib/python3.9/site-packages/ytmusicapi/parsers/utils.py", line 28, in get_item_text
    return column['text']['runs'][run_index]['text']
IndexError: list index out of range
sigma67 commented 3 years ago

Yes, that's probably related to a ytmusicapi fix that hasn't been released yet https://github.com/sigma67/ytmusicapi/commit/641178d06787dd4e1e8037f8a5f1369a72bb8869

sigma67 commented 3 years ago

I just published a release for ytmusicapi, please try again with 0.15.1