Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: KeyError: 'playNavigationEndpoint' #123

Closed
chaos87 opened this issue Dec 16, 2020 · 2 comments
Closed

Search: KeyError: 'playNavigationEndpoint' #123

chaos87 opened this issue Dec 16, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@chaos87
Copy link

chaos87 commented Dec 16, 2020

First of all thanks for the quick turnaround with v0.12

I'm testing it, and I found an example where search breaks

from ytmusicapi import YTMusic
ytmusic = YTMusic()

results = ytmusic.search("dinosaur jr.")

returns

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-3-3361a2d6b6c2> in <module>()
----> 1 results = ytmusic.search("dinosaur jr")

/usr/local/lib/python3.6/dist-packages/ytmusicapi/parsers/browsing.py in parse_search_results(self, results, resultType)
     29             if resultType in ['song', 'video']:
     30                 search_result['videoId'] = nav(
---> 31                     data, PLAY_BUTTON)['playNavigationEndpoint']['watchEndpoint']['videoId']
     32                 search_result['title'] = get_item_text(data, 0)
     33 

KeyError: 'playNavigationEndpoint'
@sigma67
Copy link
Owner

sigma67 commented Dec 16, 2020

This must be new as well, I don't recall seeing unplayable items turn up in search results. Thanks for testing it!

@sigma67 sigma67 added the bug Something isn't working label Dec 16, 2020
@sigma67
Copy link
Owner

sigma67 commented Dec 16, 2020

Feel free to reopen if you happen to find another query with issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants