Is there any way to do async login?
I'm trying to integrate this library into a BeeWare GUI app, and having async issues. I suspect it's because from_login is synchronous. Is there any way to perform async login, or is there perhaps another cause of my problem?
@anderspitman
I've created the branch https://github.com/mkb79/Audible/tree/issue/make-login-async. Can you try it out and report back?!
Edit: I wrote the code with my iPhone and does not verified it. But it should work.
Wow that was quick thank you!
It's almost working. I just needed to await otp_callback for my code to work:
https://github.com/mkb79/Audible/blob/2e4390fca307a03259365316b31bcd05e8d0e6b0/src/audible/login.py#L488
Wow that was quick thank you!
It's almost working. I just needed to await otp_callback for my code to work:
Line 488 in 2e4390f
otp_code = otp_callback()
Good to hear that! You are using your own otp callback function? Then yes, this must be awaited too.
Yeah custom otp_callback because I'm showing an input dialog to the user if the OTP is triggered. I'll likely need to do the same for the other callbacks
Yeah custom otp_callback because I'm showing an input dialog to the user if the OTP is triggered. I'll likely need to do the same for the other callbacks
Ah, okay. I doesn't know that. Than you have to await your other custom callbacks in the login function too, if they are coroutines/Awaitables.
Is there a way to implement it in your library so that it works whether the user provides a sync or async callback? Not sure if that's possible in Python
@anderspitman Only the login function needs packages like beautifulsoup or pillow. So I've tinking about outsourcing the login and register function in a separate package. This way the main package needs less dependencies. Then I can implement sync and async functions without overhaul the main package.
This issue has not been updated for a while and will be closed soon.
This issue has automatically been closed due to no activities.
@mkb79 is this still planned eventually?
This issue has not been updated for a while and will be closed soon.
This issue has automatically been closed due to no activities.