mirror of
https://github.com/kokarare1212/librespot-python.git
synced 2026-04-25 08:35:49 +03:00
[GH-ISSUE #77] Is it possible to save session? #6
Labels
No labels
bug
dependencies
duplicate
enhancement
invalid
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot-python-kokarare1212#6
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @staniel359 on GitHub (Sep 30, 2021).
Original GitHub issue: https://github.com/kokarare1212/librespot-python/issues/77
Hello. I wrote a script for audio fetching using your library. But the problem is each time the script is executed, each time session is created and it takes time. Is it possible to initialize session once for multiple script runs?
@kokarare1212 commented on GitHub (Oct 1, 2021):
Thank you for your inquiry.
Session connects to Spotify's server via a socket, which slows down the initialization process.
I don't know what kind of multiple scripts you are referring to, but you might want to use threading to share the session class and run it in multiple threads.
@kokarare1212 commented on GitHub (Oct 20, 2021):
Since there has been no response for a long time, this issue will be closed.
@staniel359 commented on GitHub (Dec 21, 2021):
@kokarare1212 Sorry for no response.
I meant that I have a script and I execute it multiple times. And each time session is created.
I wonder is it possible to initialize Session once and reuse it in each script execution?
@kokarare1212 commented on GitHub (Dec 21, 2021):
Basically, you can't reuse the session variables since they are being processed while connected to Spotify's server,
but you may be able to create another scripts (daemon?) to pass the session variables from there.
@staniel359 commented on GitHub (Dec 22, 2021):
@kokarare1212 Is it possible do serialize/deserialize
Sessionobject?@kokarare1212 commented on GitHub (Dec 22, 2021):
I haven't tested it, but I think you need to reconnect if you use pickle or something.
@staniel359 commented on GitHub (Dec 22, 2021):
@kokarare1212 I see, thanks.
@pdtan commented on GitHub (Aug 10, 2024):
@kokarare1212 Does session get expired? Any function to check if session is active?
@kokarare1212 commented on GitHub (Aug 10, 2024):
As far as I can remember, it probably has an expiration date but has never reached it, and an exception should be thrown if it expires.