Closed KoljaWindeler closed 6 months ago
Ok, finally understood that I needed a refreshtoken .. working again.
Hi, sorry for the trouble with the breaking changes. The refactoring was not initiated by me but I take full responsibility.
I hope it all worked out and the class structure makes sense from your perspective. Feel free to suggest improvements
No worries, it just took forever to understand it. Another thing that is odd: I had to redo all token. Is this expected? That would mean that all users would have to reconfigure all installations .. oh oh ;)
No, the format should stay the same. What issue did you face?
So .. I usually have my dev PC and my productive PC in sync .. same token files .. that used to work fine.
So here I copy my real PC -> Dev PC
jkw@jkw-Lenovo-YOGA-3-Pro-1370 /home/projects/ytube_music_player (git)-[main] % sudo scp jkw@192.168.2.84:/tmp/ytube_header_carlo.json ../homeassistant/.storage/header_ytube_music_player_kolja.json
jkw@192.168.2.84's password:
ytube_header_carlo.json 100% 564 101.8KB/s 00:00
jkw@jkw-Lenovo-YOGA-3-Pro-1370 /home/projects/ytube_music_player (git)-[main] % cat ../homeassistant/.storage/header_ytube_music_player_kolja.json
{
"access_token": "ya29.a0AfB_byDxnqWV76DWxTcnXNxxxxxxxxxxxxxpB5zr8Uiq6yHOJLQZHxtlKW7O1rIdF8Hc0HLi3SV8Uo1uF7Dh9ixSYVoo9oTxXxIIsKYT8SWAq_tv2V_jpjFb-ovShWIcs7ByIS455R0oCIE2p6SLqMOZovdbQxthPmQaCgYKAUgSARISFQHGX2MiLB_8KobQkG57eZ8ddBdVgA0185",
"expires_in": 84007,
"refresh_token": "1//097C28v63-JcUCgYIARAAGAkSNwFxxxxxxxxxxxxD148jXoQGqATEuSnXhvuaCLzJ_i4A1C-ZZ6lfItBWffLv7vLr28n0MyQhA",
"scope": "https://www.googleapis.com/auth/youtube",
"token_type": "Bearer",
"expires_at": 1704131622,
"filepath": "/config/.storage/ytube_header_carlo.json"
}%
This usually worked fine .. the token also still works fine on the productive setup but on my dev setup it results in an exception on the init
api = await hass.async_add_executor_job(YTMusic,path)
after running another setup routine the file looks like this
jkw@jkw-Lenovo-YOGA-3-Pro-1370 /home/projects/ytube_music_player (git)-[main] % cat ../homeassistant/.storage/header_ytube_music_player_kolja.json
{
"scope": "https://www.googleapis.com/auth/youtube",
"token_type": "Bearer",
"access_token": "ya29.a0AfB_byBCmkDbsCYf3jZAgAZecscFp-xxxxxxxxxxxOWIrjvgcQEH3aCCfc6jTnQkxkJ4lP2BOT8BSSmEo4j9P7IlMCt4PWwxxG0srMPfdZWRfXH782urOZLkFSSWrK7z3QaZJLJR_gqkbAG9m3JsyvSfSelchN8OXn-aVzEmaCgYKAdQSARASFQHGX2MivAFTJDmcN7ZjULFZeQALbg0183",
"refresh_token": "1//09HQTBYoncLgrCgYIARAAGAkSNwF-L9IxxxxxxxxxxxxxxsDvjBkSvQNzO50ltqacI2uvERkd5to1n9jk0_Lgl1eFVroH5DgAw",
"expires_at": 1704738451,
"expires_in": 77479
}%
any idea? I'll try tomorrow to create a token file on 1.3.2 and load that using 1.4.2 both on my dev pc .. same machine for both but I'm almost sure that it will fail
hmm never mind .. works .. strange .. maybe my testing killed something .. not sure .. will report if this happens to other users when all change to 1.4.2
Hi @sigma67, as you know I'm using your code to provide access to ytubemusic to users of homeassistant with this integration https://github.com/KoljaWindeler/ytube_music_player
I've added oAuth a while back and it worked absolutely awesome!! great work To be honest: I don't understand how to re-work it after the code was refactored :( can you give me a hand?
what i did was
I understood that
transitioned to
correct?
And
moved into
but is not longer failing when the oauto process wasn't completed, correct? is there any way for me to check if it did?
How do I store the token? I've tried several things but it looks like my skills are limited here. Can you help me restore the original behavior (not by changing your code but by helping me with the correct calls)