Spodcast icon indicating copy to clipboard operation
Spodcast copied to clipboard

WARNING:Librespot:CdnManager:Couldn't extract expiration, invalid parameter in CDN

Open jamesvincent opened this issue 1 year ago • 3 comments

Windows 11 Docker Desktop (WSL2)

I'm launching Spodcast using a custom wrapper. This has worked flawlessly for 12+ months I'd say...

Write-Output "Stop any existing/stale containers"
docker ps -q | % { docker stop $_ }
docker container prune -f
Write-Output "Check for new Image updates"
docker pull heywoodlh/spodcast:latest
#docker pull heywoodlh/spodcast-web:latest
#docker pull heywoodlh/spodcast-cron:latest
Write-Output "Run Spodcast and check for latest episodes"
docker run --rm -it -v c:\ProgramData\spodcast:/data heywoodlh/spodcast -c /data/spodcast.json --log-level debug --transcode yes --root-path /data/html --rss-feed yes --max-episodes 8 https://open.spotify.com/show/1Zuurv8AZFWti60lSXiDgz https://open.spotify.com/show/7LuQv400JFzzlJrOuMukRj
#docker container prune -f
Write-Output "Complete"
Write-Output "Killing Docker Desktop Sessions"
Start-Sleep -Seconds 10
#taskkill /F /IM "Docker Desktop.exe"
docker image prune -f
Stop-Transcript

It's hard to put an exact timeframe on it, but my last successful download was ~27th December. Since then, I've been getting issues like this;

INFO:spodcast.podcast:Fetching episode information...
WARNING:Librespot:CdnManager:Couldn't extract expiration, invalid parameter in CDN url: https://audio4-gm-fb.spotifycdn.com/audio/66532ad6c2a84033378fb291901740166002fe70?Expires=1704662349~FullPath~hmac=43xVHO4qgCARU8WSv9y-sz4wk1vonvfaAIMZ865CK94=
Traceback (most recent call last):
  File "/usr/local/bin/spodcast", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.12/site-packages/spodcast/__main__.py", line 42, in main
    args.func(args)
  File "/usr/local/lib/python3.12/site-packages/spodcast/app.py", line 30, in client
    download_episode(episode_id)
  File "/usr/local/lib/python3.12/site-packages/spodcast/podcast.py", line 167, in download_episode
    stream = Spodcast.get_content_stream(episode_stream_id, Spodcast.DOWNLOAD_QUALITY)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/spodcast/spodcast.py", line 111, in get_content_stream
    return cls.SESSION.content_feeder().load(content_id, VorbisOnlyAudioQuality(quality), False, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 725, in load
    return self.load_episode(playable_id, audio_quality_picker,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 763, in load_episode
    return self.load_stream(file, None, episode, preload, halt_listener)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 739, in load_stream
    return CdnFeedHelper.load_episode(self.__session, episode, file,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 391, in load_episode
    streamer = session.cdn().stream_file(file, key, url, halt_listener)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 438, in stream_file
    return CdnManager.Streamer(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 561, in __init__
    response = self.request(range_start=0,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/librespot/audio/__init__.py", line 622, in request
    raise IOError(response.status_code)
OSError: 404

I've gone back through the readme and effectively performed clean installs, re-adding credentials etc, to very little avail.

The example in the readme does /occasionally/ work... docker run -it -v c:\ProgramData\spodcast:/data heywoodlh/spodcast -c /data/spodcast.json --log-level info --max-episodes 1 'https://open.spotify.com/show/4rOoJ6Egrf8K2IrywzwOMk'

...so I'm unsure what's causing the more often than not, errors.... issues with the episode/filenames perhaps?

jamesvincent avatar Jan 06 '24 21:01 jamesvincent

Occasionally getting --

ValueError: invalid literal for int() with base 10: 'Expires=1704662961~FullPath~hmac=-dWE2nKEJkT-kblZMV24Fc'

jamesvincent avatar Jan 06 '24 21:01 jamesvincent

Pretty sure that's this issue: https://github.com/librespot-org/librespot/pull/1183 That should be fixed in librespot, but I don't know why that isn't updated in Spodcast yet. I just run the command a couple of times, when you get domains with the 'old' expiration format it works.

denniskrol avatar Jan 25 '24 03:01 denniskrol

Things have not been updated in Spodcast because I'm busy with other things. I'll try to give this some time (trying right now but the spotty mobile network in this German train is not helping...) to see if I can get it back on track.

Yetangitu avatar Feb 08 '24 14:02 Yetangitu