No way to get all videos from user
zehkira opened this issue · 5 comments
The data returned by get_user()
contains some, but not all of the user's videos. The documentation for get_user()
does not explain how to get the rest.
Attempting to use get_playlist()
with the videos
browseId
results in the following error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zee/.local/lib/python3.12/site-packages/ytmusicapi/mixins/playlists.py", line 108, in get_playlist
response = self._send_request(endpoint, body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zee/.local/lib/python3.12/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.
(This browseId
is the same as the user's - not sure if this is intentional or a bug.)
results = yt_auth.get_user_playlists(channel, user["playlists"]["params"])
With get_user('UCus8EVJ7Oc9zINhs-fg8l1Q')
I got the following:
"params": "6gPiAUdxWUJXcFlCQ3BNQkNpUjVkRjl3WVdkbFgzTnVZWEJ6YUc5MFgyMTFjMmxqWDNCaFoyVmZjbVZuYVc5dVlXd1NIMmQ2WWpkRlREUk1WemRCVlhkTFEzcEJiVU5RYzNKbGFrRTVZa05FUW1zYVNnQUFaVzRBQVZCTUFBRlFUQUFCQUVaRmJYVnphV05mWkdWMFlXbHNYMkZ5ZEdsemRBQUJBVU1BQUFFQUFBRUJBRlZEZFhNNFJWWktOMDlqT1hwSlRtaHpMV1puT0d3eFVRQUI4dHF6cWdvSFFBQklBRkNPQVE%3D",
This is from user['videos']
, not user['playlists']
- there is no params
in playlists
.
I then did this:
get_user_playlists('UCus8EVJ7Oc9zINhs-fg8l1Q', '6gPiAUdxWUJXcFlCQ3BNQkNpUjVkRjl3WVdkbFgzTnVZWEJ6YUc5MFgyMTFjMmxqWDNCaFoyVmZjbVZuYVc5dVlXd1NIMmQ2WWpkRlREUk1WemRCVlhkTFEzcEJiVU5RYzNKbGFrRTVZa05FUW1zYVNnQUFaVzRBQVZCTUFBRlFUQUFCQUVaRmJYVnphV05mWkdWMFlXbHNYMkZ5ZEdsemRBQUJBVU1BQUFFQUFBRUJBRlZEZFhNNFJWWktOMDlqT1hwSlRtaHpMV1puT0d3eFVRQUI4dHF6cWdvSFFBQklBRkNPQVE%3D')
And got nothing as a result:
[]
I'm not sure what you're doing but the information you provide is incomplete and not reproducible
The user you provided only has 4 playlists, so it won't have any params and you can't use get_user_playlists
on it.
Then how am I supposed to get all of that user's videos?
Ah, I see now. It seems an endpoint get_user_videos
is missing. Strange no one has asked for it all this time.
PR welcome