kokarare1212 / librespot-python

Open Source Spotify Client
http://librespot-python.rtfd.io
Apache License 2.0
220 stars 43 forks source link

[REQUEST] change stored_credentials path #251

Closed van4oza closed 9 months ago

van4oza commented 9 months ago

I'm trying to use librespot in AWS Lambda, but the only RW dir there is /tmp. librespot keeps creating credentials file in os.getcwd(). even if I override it keeps getting back and failing

spotify_builder = Session.Builder()
spotify_builder.conf.stored_credentials_file = "/tmp/conf/spotify_credentials.json"
session = spotify_builder.user_pass("test@test.test", "mypswd").create()

Probably there is solution already?

kokarare1212 commented 9 months ago

Perhaps passing Session.Configuration as an argument to the constructor of Session.Builder will work.

https://github.com/kokarare1212/librespot-python/blob/main/librespot/core.py#L1367-L1420 https://github.com/kokarare1212/librespot-python/blob/main/librespot/core.py#L1690-L1840

van4oza commented 9 months ago

thx!