sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
954 stars 72 forks source link

Crash importing a specific playlist #25

Closed CappyT closed 2 years ago

CappyT commented 2 years ago

I imported all of my playlists fine, however this one generates an error.

https://open.spotify.com/playlist/37i9dQZF1DWVY4eLfA3XFQ

I simply ran: python3 YouTube.py https://open.spotify.com/playlist/37i9dQZF1DWVY4eLfA3XFQ

Traceback (most recent call last):
  File "YouTube.py", line 190, in <module>
    main()
  File "YouTube.py", line 182, in main
    videoIds = ytmusic.search_songs(playlist['tracks'])
  File "YouTube.py", line 70, in search_songs
    result = self.api.search(query)
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/mixins/browsing.py", line 179, in search
    search_results.extend(self.parser.parse_search_results(results, type, category))
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/helpers.py", line 126, in _impl
    return method(self, *method_args, **method_kwargs)
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/parsers/browsing.py", line 39, in parse_search_results
    parse_menu_playlists(data, search_result)
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 5, in parse_menu_playlists
    watch_menu = find_objects_by_key(nav(data, MENU_ITEMS), 'menuNavigationItemRenderer')
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 155, in nav
    raise err
  File "/home/cappyt/.local/lib/python3.8/site-packages/ytmusicapi/parsers/utils.py", line 149, in nav
    root = root[k]
KeyError: 'menu'

Hope this helps.

sigma67 commented 2 years ago

Are you using an old version of ytmusicapi? Make sure your dependencies are up to date. It's working fine for me.

https://music.youtube.com/playlist?list=PL528pVfw3ao1z-U8b17y4PoTB1caMTHIW

nathan-512 commented 2 years ago

How can you update your ytmusiccapi? I'm having the same error rn

sigma67 commented 2 years ago

pip install -U -r requirements