luisignaciocc / youtube-music-scrobbler

a python script to scrobble your YouTube Music history to Last.fm
MIT License
27 stars 5 forks source link

last auth doesnt work #2

Closed RobDiek closed 9 months ago

RobDiek commented 9 months ago

Hi seems the session getting doesnt work :(

Waiting for authentication ... 127.0.0.1 - - [10/0ct/2023 13:23: 42] "GET /?token=XXXXXXXXXXXXXXXXXXXXXXXHTTP/1.1" 200 - Getting session ... <? xml version="1.0" encoding="UTF-8"?>

Invalid method signature supplied

Traceback (most recent call last): File "/home/robin/Downloads/youtube-music-scrobbler/start.py", line 89, in get_session token = root. find('session/key'). text AttributeError: 'NoneType' object has no attribute 'text' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/robin/Downloads/youtube-music-scrobbler/start.py", line 153, in Process() .execute() File "/home/robin/Downloads/youtube-music-scrobbler/start.py", line 101, in execute self.session = self.get_session(token) File "/home/robin/Downloads/youtube-music-scrobbler/start.py", line 94, in get_session raise Exception(e) Exception: 'NoneType' object has no attribute 'text'

any idea what to do? :)

luisignaciocc commented 9 months ago

Hello! the browser is opening? In that step, you're supposed to give the app permissions from the lastfm website. A browser will pop up with the authorization URL.

RobDiek commented 9 months ago

yes this is exactly what I do I get lastfm access request - click on "Yes" and it says "authentication okay" in browser but gives me error in terminal

RobDiek commented 9 months ago

you can see it here (ignore background please, was watching a video and didnt relaize it was recording sound :D ) https://youtu.be/MjqcgDY6Eqk?t=15

luisignaciocc commented 9 months ago

ok try putting the lastfm token hardcoded here like this:

        if not self.session:
            # token = self.get_token()
            token = "YOUR_TOKEN_HERE"
            self.session = self.get_session(token)

this is the token you need to paste: Capture d’écran du 2023-10-10 09-27-23

let's see if that works

luisignaciocc commented 9 months ago

You know what, I can see the error image

that means there's a problem with your LAST_FM_API_SECRET. It's set correctly?

RobDiek commented 9 months ago

its the shared API secret right? yeah, double checked it and just created a new one to be sure - both key and secret are correct.

luisignaciocc commented 9 months ago

Yes. try to print the params here: https://github.com/luisignaciocc/youtube-music-scrobbler/blob/master/lastpy/__init__.py#L15-L24

To see if everything is ok

RobDiek commented 9 months ago

interesting after a restart it works but it now shows "0 scrobbles" is it because I have way more then 200 scrobbles ?

RobDiek commented 9 months ago

ah wait, seems it only gets the plays of the device the script is ran on? when i start one song it gives me back 1 scrobble but the rest of all my other devices isnt synced even though I have the listening history visible. must be my thing then. Thanks! :)

luisignaciocc commented 9 months ago

no no, it scrobbles from all the devices. it just scrobbles the recently played songs, so history older than 1 day will not be scrobbled

RobDiek commented 9 months ago

ah I see. hmm i need this for like the last 365 days :D thanks for this though! :)