You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
get_home() query no longer works
Hello, I noticed recently that the script I used to get music suggestions no longer works. The error message isn't very clear so I'm not sure what the issue might be but the script worked a few days ago and also returns results when using something like yt.search("Oasis Wonderwall")...
Traceback (most recent call last):
File "/home/user/.local/share/pipx/venvs/ytmusicapi/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 107, in nav
root = root[k]
~~~~^^^
KeyError: 'watchEndpoint'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/.local/bin/ytmusicapi_home.py", line 14, in<module>
search_results = yt.get_home(30)
^^^^^^^^^^^^^^^
File "/home/user/.local/share/pipx/venvs/ytmusicapi/lib/python3.12/site-packages/ytmusicapi/mixins/browsing.py", line 118, in get_home
home.extend(parse_mixed_content(results))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/pipx/venvs/ytmusicapi/lib/python3.12/site-packages/ytmusicapi/parsers/browsing.py", line 27, in parse_mixed_content
content = parse_song(data)
^^^^^^^^^^^^^^^^
File "/home/user/.local/share/pipx/venvs/ytmusicapi/lib/python3.12/site-packages/ytmusicapi/parsers/browsing.py", line 86, in parse_song
"videoId": nav(result, NAVIGATION_VIDEO_ID),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/share/pipx/venvs/ytmusicapi/lib/python3.12/site-packages/ytmusicapi/navigation.py", line 111, in nav
raise type(e)(f"Unable to find '{k}' using path {items!r} on {root!r}, exception: {e}")
KeyError: "Unable to find 'watchEndpoint' using path ['navigationEndpoint', 'watchEndpoint', 'videoId'] on {'clickTrackingParams': 'CLECEKCzAhgAIhMIiZiNtpq6iQMVTgq3AB2ZTTys', 'browseEndpoint': {'browseEndpointContextSupportedConfigs': {'browseEndpointContextMusicConfig': {'pageType': 'MUSIC_PAGE_TYPE_ARTIST'}}}}, exception: 'watchEndpoint'"
Note that I just tried to generate oauth using another account and this appears to work. Also, I just modified navigation.py to print the content of the root variable and it does contain data, it even contains keys called watchEndpoint so I'm not 100% sure what the case of the issue is... could it be the some issue with the type of playlists (music Vs videos?)
Edit2: I tried using get_home(1) and it worked, then tried again and it no longer work. So perhaps an again issue with the content of the results?
Edit3: using timestamps, I was able to establish that the script does run for a few entries. However, when it lands on some it cannot find the 'watchEndpoint' key and crashing instead of skipping to the next. Is it possible to continue rather than crashing?
The text was updated successfully, but these errors were encountered:
ok, I temporarily "solved it" by updating navigation.py from
try:
forkinitems:
root=root[k]
except (KeyError, IndexError, TypeError) ase:
ifnone_if_absent:
returnNoneraisetype(e)(f"Unable to find '{k}' using path {items!r} on {root!r}, exception: {e}")
returnroot
to
try:
forkinitems:
root=root[k]
except (KeyError, IndexError, TypeError) ase:
ifnone_if_absent:
returnNoneraisetype(e)(f"Unable to find '{k}' using path {items!r} on {root!r}, exception: {e}")
returnroot
but frankly, I still don't think that this shouldn't result in a crash, at best it should be a warning or perhaps skip 'MUSIC_PAGE_TYPE_ARTIST' if that's the type of pages generating issues?
get_home() query no longer works
Hello, I noticed recently that the script I used to get music suggestions no longer works. The error message isn't very clear so I'm not sure what the issue might be but the script worked a few days ago and also returns results when using something like
yt.search("Oasis Wonderwall")
...To Reproduce
Test Script using get_home ( doesn't work)
Result
Note that I just tried to generate oauth using another account and this appears to work. Also, I just modified navigation.py to print the content of the
root
variable and it does contain data, it even contains keys calledwatchEndpoint
so I'm not 100% sure what the case of the issue is... could it be the some issue with the type of playlists (music Vs videos?)Edit2: I tried using get_home(1) and it worked, then tried again and it no longer work. So perhaps an again issue with the content of the results?
Edit3: using timestamps, I was able to establish that the script does run for a few entries. However, when it lands on some it cannot find the
'watchEndpoint'
key and crashing instead of skipping to the next. Is it possible to continue rather than crashing?The text was updated successfully, but these errors were encountered: