Yetangitu / Spodcast

Spodcast is a caching Spotify podcast to RSS proxy. Using Spodcast you can follow Spotify-hosted netcasts/podcasts using any player which supports RSS, thus enabling the use of older hardware which is not compatible with the Spotify (web) app.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Session.SpotifyAuthenticationException: PremiumAccountRequired

lucajet opened this issue · comments

hello,
since today, after weeks of usage, i receive this exception

librespot.core.Session.SpotifyAuthenticationException: PremiumAccountRequired

i tried to login again with

docker run -it -v /tmp/spodcast:/data heywoodlh/spodcast -c /data/spodcast.json --root-path /data/html --log-level info --credentials-location /data/creds.json -p -l /data/spotify.rc

but with no luck.
My account still work from web, to listen to the very same podcast i'm trying to fetch.

Same Problem here...

Traceback (most recent call last):
  File "/var/www/.local/bin/spodcast", line 8, in <module>
    sys.exit(main())
  File "/var/www/.local/lib/python3.9/site-packages/spodcast/__main__.py", line 42, in main
    args.func(args)
  File "/var/www/.local/lib/python3.9/site-packages/spodcast/app.py", line 14, in client
    Spodcast(args)
  File "/var/www/.local/lib/python3.9/site-packages/spodcast/spodcast.py", line 54, in __init__
    Spodcast.login()
  File "/var/www/.local/lib/python3.9/site-packages/spodcast/spodcast.py", line 78, in login
    session = Session.Builder(conf).stored_file().create()
  File "/var/www/.local/lib/python3.9/site-packages/librespot/core.py", line 1287, in create
    session.authenticate(self.login_credentials)
  File "/var/www/.local/lib/python3.9/site-packages/librespot/core.py", line 709, in authenticate
    self.__authenticate_partial(credential, False)
  File "/var/www/.local/lib/python3.9/site-packages/librespot/core.py", line 1067, in __authenticate_partial
    raise Session.SpotifyAuthenticationException(ap_login_failed)
librespot.core.SpotifyAuthenticationException: PremiumAccountRequired

Update:

I was able to solve the problem -at least for me- by updating from "librespot-0.0.8" -> "librespot-0.0.9" using

pip install git+https://github.com/kokarare1212/librespot-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting git+https://github.com/kokarare1212/librespot-python
  Cloning https://github.com/kokarare1212/librespot-python to /tmp/pip-req-build-qj__fvx0
  Running command git clone --filter=blob:none --quiet https://github.com/kokarare1212/librespot-python /tmp/pip-req-build-qj__fvx0
  Resolved https://github.com/kokarare1212/librespot-python to commit 126ce3ad94fc349aad85858098df27527bd50acc
  Preparing metadata (setup.py) ... done
Requirement already satisfied: defusedxml==0.7.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (0.7.1)
Requirement already satisfied: protobuf==3.20.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (3.20.1)
Requirement already satisfied: pycryptodomex==3.17 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (3.17)
Requirement already satisfied: pyogg==0.6.14a.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (0.6.14a1)
Collecting requests==2.30.0 (from librespot==0.0.9)
  Downloading https://www.piwheels.org/simple/requests/requests-2.30.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 4.4 MB/s eta 0:00:00Requirement already satisfied: websocket-client==1.5.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (1.5.1)
Collecting zeroconf==0.62.0 (from librespot==0.0.9)
  Downloading https://www.piwheels.org/simple/zeroconf/zeroconf-0.62.0-cp39-cp39-manylinux_2_31_armv7l.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.4 MB/s eta 0:00:00Requirement already satisfied: charset-normalizer<4,>=2 in /var/www/.local/lib/python3.9/site-packages (from requests==2.30.0->librespot==0.0.9) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (2.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (1.26.5)Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (2020.6.20)
Requirement already satisfied: async-timeout>=3.0.0 in /var/www/.local/lib/python3.9/site-packages (from zeroconf==0.62.0->librespot==0.0.9) (4.0.2)
Requirement already satisfied: ifaddr>=0.1.7 in /var/www/.local/lib/python3.9/site-packages (from zeroconf==0.62.0->librespot==0.0.9) (0.2.0)
Building wheels for collected packages: librespot
  Building wheel for librespot (setup.py) ... done
  Created wheel for librespot: filename=librespot-0.0.9-py3-none-any.whl size=132775 sha256=6cd2b368b9c4a648f9a57a3b5abbfc2eff9b5f3aed564b5b91a31d237efd5e29
  Stored in directory: /tmp/pip-ephem-wheel-cache-y9a4x4ro/wheels/de/9e/9e/746ebea26d5bef626ff0e3d19c335b2890ad7718233c9194ef
Successfully built librespot
Installing collected packages: zeroconf, requests, librespot
  Attempting uninstall: zeroconf
    Found existing installation: zeroconf 0.55.0
    Uninstalling zeroconf-0.55.0:
      Successfully uninstalled zeroconf-0.55.0
  Attempting uninstall: requests
    Found existing installation: requests 2.28.2
    Uninstalling requests-2.28.2:
      Successfully uninstalled requests-2.28.2
  Attempting uninstall: librespot
    Found existing installation: librespot 0.0.8
    Uninstalling librespot-0.0.8:
      Successfully uninstalled librespot-0.0.8
Successfully installed librespot-0.0.9 requests-2.30.0 zeroconf-0.62.0

now everything works again as before and expected.

@lucajet : You seem to be using spodcast as a docker image. Here, changing this component is probably only possible by recompiling the image.

great! i made a pip install and work great!
thank you @d3545t3r !

commented

Update:

I was able to solve the problem -at least for me- by updating from "librespot-0.0.8" -> "librespot-0.0.9" using

pip install git+https://github.com/kokarare1212/librespot-python
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple/
Collecting git+https://github.com/kokarare1212/librespot-python
 Cloning https://github.com/kokarare1212/librespot-python to /tmp/pip-req-build-qj__fvx0
 Running command git clone --filter=blob:none --quiet https://github.com/kokarare1212/librespot-python /tmp/pip-req-build-qj__fvx0
 Resolved https://github.com/kokarare1212/librespot-python to commit 126ce3ad94fc349aad85858098df27527bd50acc
 Preparing metadata (setup.py) ... done
Requirement already satisfied: defusedxml==0.7.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (0.7.1)
Requirement already satisfied: protobuf==3.20.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (3.20.1)
Requirement already satisfied: pycryptodomex==3.17 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (3.17)
Requirement already satisfied: pyogg==0.6.14a.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (0.6.14a1)
Collecting requests==2.30.0 (from librespot==0.0.9)
 Downloading https://www.piwheels.org/simple/requests/requests-2.30.0-py3-none-any.whl (62 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.5/62.5 kB 4.4 MB/s eta 0:00:00Requirement already satisfied: websocket-client==1.5.1 in /var/www/.local/lib/python3.9/site-packages (from librespot==0.0.9) (1.5.1)
Collecting zeroconf==0.62.0 (from librespot==0.0.9)
 Downloading https://www.piwheels.org/simple/zeroconf/zeroconf-0.62.0-cp39-cp39-manylinux_2_31_armv7l.whl (2.1 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.4 MB/s eta 0:00:00Requirement already satisfied: charset-normalizer<4,>=2 in /var/www/.local/lib/python3.9/site-packages (from requests==2.30.0->librespot==0.0.9) (3.1.0)
Requirement already satisfied: idna<4,>=2.5 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (2.10)
Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (1.26.5)Requirement already satisfied: certifi>=2017.4.17 in /usr/lib/python3/dist-packages (from requests==2.30.0->librespot==0.0.9) (2020.6.20)
Requirement already satisfied: async-timeout>=3.0.0 in /var/www/.local/lib/python3.9/site-packages (from zeroconf==0.62.0->librespot==0.0.9) (4.0.2)
Requirement already satisfied: ifaddr>=0.1.7 in /var/www/.local/lib/python3.9/site-packages (from zeroconf==0.62.0->librespot==0.0.9) (0.2.0)
Building wheels for collected packages: librespot
 Building wheel for librespot (setup.py) ... done
 Created wheel for librespot: filename=librespot-0.0.9-py3-none-any.whl size=132775 sha256=6cd2b368b9c4a648f9a57a3b5abbfc2eff9b5f3aed564b5b91a31d237efd5e29
 Stored in directory: /tmp/pip-ephem-wheel-cache-y9a4x4ro/wheels/de/9e/9e/746ebea26d5bef626ff0e3d19c335b2890ad7718233c9194ef
Successfully built librespot
Installing collected packages: zeroconf, requests, librespot
 Attempting uninstall: zeroconf
   Found existing installation: zeroconf 0.55.0
   Uninstalling zeroconf-0.55.0:
     Successfully uninstalled zeroconf-0.55.0
 Attempting uninstall: requests
   Found existing installation: requests 2.28.2
   Uninstalling requests-2.28.2:
     Successfully uninstalled requests-2.28.2
 Attempting uninstall: librespot
   Found existing installation: librespot 0.0.8
   Uninstalling librespot-0.0.8:
     Successfully uninstalled librespot-0.0.8
Successfully installed librespot-0.0.9 requests-2.30.0 zeroconf-0.62.0

now everything works again as before and expected.

@lucajet : You seem to be using spodcast as a docker image. Here, changing this component is probably only possible by recompiling the image.

Thanks!

If you use docker you have to edit setup.cfg:

install_requires =
    librespot >= 0.0.9

and build again.

@Yetangitu @heywoodlh anything you can do?

I see @heywoodlh updated the docker image 13h ago, maybe it includes this fix --- just about to try!

https://hub.docker.com/r/heywoodlh/spodcast/tags

Edit: Can confirm it works :) Deleted my local Image and pulled the new. Thank you so much @heywoodlh !