[GH-ISSUE #262] Error on get_mood_playlist #207

Closed
opened 2026-02-27 22:08:36 +03:00 by kerem · 2 comments
Owner

Originally created by @Spsden on GitHub (Feb 22, 2022).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/262

Code .



from re import L
from flask import Flask, jsonify, request
from markupsafe import re, string 
from ytmusicapi import YTMusic 
  
app = Flask(__name__) 

ytmusic = YTMusic()
#creating the Flask class object   
 
@app.route('/search', methods = ['GET']) #decorator drfines the   
def search():  



    moodlist = []
    moodlist = ytmusic.get_mood_playlists('ggMPOg1uXzZQbDB5eThLRTQ3')


    return jsonify(moodlist)


if __name__ =='__main__':  
 app.run(host="0.0.0.0",)  


Output ..


[2022-02-22 18:46:50,608] ERROR in app: Exception on /search [GET]
Traceback (most recent call last):
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2073, in wsgi_app
    response = self.full_dispatch_request()
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request
    rv = self.dispatch_request()
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1502, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "d:\beep\flaskBackend\test.py", line 18, in search
    moodlist = ytmusic.get_mood_playlists('ggMPOg1uXzZQbDB5eThLRTQ3')
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\ytmusicapi\mixins\explore.py", line 72, in get_mood_playlists
    response = self._send_request('browse', {
  File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\ytmusicapi\ytmusic.py", line 142, in _send_request
    raise Exception(message + error)
Exception: Server returned HTTP 404: Not Found.
Requested entity was not found.


I have implemented most other methods in a flash server
at Drip server except get_mood_playlists.

Please look into it and help me out with it.

Also awesome api , the core of my Youtube Music project Drip .
Thanks for making this awespme api.

Originally created by @Spsden on GitHub (Feb 22, 2022). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/262 Code . ```` from re import L from flask import Flask, jsonify, request from markupsafe import re, string from ytmusicapi import YTMusic app = Flask(__name__) ytmusic = YTMusic() #creating the Flask class object @app.route('/search', methods = ['GET']) #decorator drfines the def search(): moodlist = [] moodlist = ytmusic.get_mood_playlists('ggMPOg1uXzZQbDB5eThLRTQ3') return jsonify(moodlist) if __name__ =='__main__': app.run(host="0.0.0.0",) ```` Output .. ```` [2022-02-22 18:46:50,608] ERROR in app: Exception on /search [GET] Traceback (most recent call last): File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "d:\beep\flaskBackend\test.py", line 18, in search moodlist = ytmusic.get_mood_playlists('ggMPOg1uXzZQbDB5eThLRTQ3') File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\ytmusicapi\mixins\explore.py", line 72, in get_mood_playlists response = self._send_request('browse', { File "C:\Users\prata\AppData\Local\Programs\Python\Python310\lib\site-packages\ytmusicapi\ytmusic.py", line 142, in _send_request raise Exception(message + error) Exception: Server returned HTTP 404: Not Found. Requested entity was not found. ```` I have implemented most other methods in a flash server at [Drip server](https://github.com/Spsden/Drip_server) except get_mood_playlists. Please look into it and help me out with it. Also awesome api , the core of my Youtube Music project [Drip](https://github.com/Spsden/Drip) . Thanks for making this awespme api.
kerem closed this issue 2026-02-27 22:08:36 +03:00
Author
Owner

@sigma67 commented on GitHub (Feb 22, 2022):

Nice project! The endpoint works for me. Are you sure your params string is valid? You need to call get_mood_categories beforehand.

<!-- gh-comment-id:1047802406 --> @sigma67 commented on GitHub (Feb 22, 2022): Nice project! The endpoint works for me. Are you sure your params string is valid? You need to call `get_mood_categories` beforehand.
Author
Owner

@Spsden commented on GitHub (Feb 22, 2022):

Nice project! The endpoint works for me. Are you sure your params string is valid? You need to call get_mood_categories beforehand.

Thank you !

I'm really sorry for bothering you, actually it was returning error for some params which I was getting from get_mood_categories while most work now. silly error from my side.
Thank you again for prompt support.

<!-- gh-comment-id:1047814099 --> @Spsden commented on GitHub (Feb 22, 2022): > Nice project! The endpoint works for me. Are you sure your params string is valid? You need to call `get_mood_categories` beforehand. Thank you ! I'm really sorry for bothering you, actually it was returning error for some params which I was getting from get_mood_categories while most work now. silly error from my side. Thank you again for prompt support.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#207
No description provided.