-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrobbling to youtube music not reflected in Recent History #58
Comments
As far as I see it's just not implemented: |
@kmac - A 204 is probably what we should get back. I've been swamped with work and haven't had a chance to look at this. I'll see if I can soon. @dionorgua - the |
Also, if I do manage to get it working again (or someone beats me to it 🙏), we should probably discuss with @sigma67 to put it in ytmusicapi instead. There're other history manipulation functions in there already. |
Very much open to a PR, this one's just flown under the radar a bit. |
This should finally be fixed in 0.3.8 |
So I've looked at the code and thought about how to implement this in ytmusicapi, but it seems it's pretty much identical to |
The CPN doesn't even matter for the player API call (just the tracking URL call). I only wrote it like this so I could get the import random
import requests
from ytmusicapi import YTMusic
YTMAPI = YTMusic("auth.json")
videoId = "xZdj3LM5X1M" # Lizzo - Good as Hell
song = YTMAPI.get_song(videoId)
CPNA = ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_")
cpn = "".join( ( CPNA[random.randint(0, 256) & 63] for _ in range(0, 16) ) )
response = requests.get(
song["playbackTracking"]["videostatsPlaybackUrl"]["baseUrl"],
params={
"ver": 2,
"c": "WEB_REMIX",
"cpn": cpn,
},
headers=YTMAPI.headers,
proxies=YTMAPI.proxies,
)
if (response.status_code == 204):
print("\"%s\" added to history." % song["videoDetails"]["title"]) And the correct signatureTimestamp doesn't even need to be used to get back the correct urls in |
Ah alright, that's a very simple change. There's no reason to exclude that key apart from excluding non-useful data. Which |
The scrobbling code seems to be working as implemented, however nothing shows up in Recent History.
We get a 204 from /api/stats/playback:
I suppose it's possible the API/mechanism changed for updating? Are others seeing the same thing?
The text was updated successfully, but these errors were encountered: