Closed CuongBa956 closed 2 years ago
It's really difficult for me. Honestly, I have no idea if it's possible.
thanks also i think its a hard thing especially for such a small project with only a single developer
It's really difficult for me. Honestly, I have no idea if it's possible.
Hey @z-huang, I noticed your InnerTube client uses a hard-coded visitorData
token. Note that this specific token is what allows InnerTube to provide algorithmic recommendations for a user, even if they are not signed in. It sort of works like a session, so to implement this you'd have to either generate the visitor data token (it is just a base64d protobuf that consists of a timestamp and a random 11 characters string, this is how I generate it in my library) or grab it from YouTube Music's service worker endpoint (https://music.youtube.com/sw.js_data), store it somewhere and use it for all requests.
That should be enough to make the home feed, up next, related, etc adapt to one's music taste.
Thanks! However, is a unique visitorData
enough for the trick? I saw that there are also log_event
and watchtime
API endpoints.
Thanks! However, is a unique
visitorData
enough for the trick? I saw that there are alsolog_event
andwatchtime
API endpoints.
Yes, playback tracking can make it better. But you do not have to ping the watchtime
endpoint (api/stats/watchtime
), this endpoint in particular is used to record watch time after playback tracking is initialized with api/stats/playback
, which is what adds songs/videos to a user's watch history (like we do here), and interestingly, also tunes recommendations for unauthenticated users. You also do not have to ping the log_event
endpoint, it is solely used for telemetry.
Thanks for your expert explanation! I'll generate a random visitorData
for each user.
Checklist
Feature description
I hope the app will have a music recommendation algorithm. for example from songs i add to my library or songs i listen to many apps can suggest me songs like that or maybe i will like on home page
Why do you want this feature?
I think it will increase the user experience of the app. I think this is a difficult thing but I hope this feature will appear
Additional information
No response