sigma67 / ytmusicapi

Unofficial API for YouTube Music
https://ytmusicapi.readthedocs.io
MIT License
1.71k stars 194 forks source link

rate_playlist() returning 404 "Requested entity was not found." #585

Closed jonathanbell closed 4 months ago

jonathanbell commented 4 months ago

Describe the bug

Version 1.7.0 - calling rate_playlist() with a valid browseId results in a 404 error/exception.

To Reproduce

Steps to reproduce the behaviour:

  1. Create a simple call to rate_playlist()
def test():
    print("Start...")
    ytmusicapi.rate_playlist(
        "VLRDCLAK5uy_nKfNEHo6Yu1lao4pamzirHgatT0liBhzY", "LIKE"
    )
    print("...End")
  1. and call it.
  2. Expect "Feelin' Good in the '80s" playlist to be added to library.
  3. Actually, see this error:
File "/<redacted>/lib/python3.11/site-packages/ytmusicapi/ytmusic.py", line 241, in _send_request
    raise Exception(message + error)
Exception: Server returned HTTP 404: Not Found.
Requested entity was not found.

Additional context

This seems to happen for both playlists and albums. I haven't tried INDIFFERENT or DISLIKE. If I find some time, I might be able to dig deeper and submit and PR. Thanks for your attention!

jonathanbell commented 4 months ago

Possibly related: https://github.com/sigma67/ytmusicapi/issues/362

sigma67 commented 4 months ago

You are using a browseId, not a playlistId.

https://ytmusicapi.readthedocs.io/en/stable/faq.html#what-is-a-browseid

jonathanbell commented 4 months ago

I’ll submit a PR to have a playlistId returned from a search for an album. Sound ok?

On Mon, May 20, 2024 at 12:56 sigma67 @.***> wrote:

You are using a browseId, not a playlistId.

https://ytmusicapi.readthedocs.io/en/stable/faq.html#what-is-a-browseid

— Reply to this email directly, view it on GitHub https://github.com/sigma67/ytmusicapi/issues/585#issuecomment-2121107463, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANA45ZT4RGA3DD22XTCPBTZDJIOVAVCNFSM6AAAAABH2XIHK2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRRGEYDONBWGM . You are receiving this because you authored the thread.Message ID: @.***>

sigma67 commented 4 months ago

If you figure out how without extra requests, sure. AFAIK search only returns browseIds.

For albums, the playlistId starts with OLA...