spotify-downloader: Cookies Not Working for High-Quality Audio Downloads in Spotdl; PO Tokens Required in YTDLP
System OS
Windows
Python Version
3.13 (CPython)
Install Source
pip / PyPi
Install version / commit hash
v4.2.11
Expected Behavior vs Actual Behavior
Since yesterday, when I use cookies to download music in high quality, the music still downloads in the same standard quality. I investigated and tried using a command in ytdlp to download audio with cookies, but it also didn’t work. Upon further investigation, I found that ytdlp now requires PO tokens to download high-quality audio from YouTube using my premium account cookies. I’m not sure if the issue is specific to my setup, but when I use PO tokens together with cookies in ytdlp, I can download high-quality music without any issues. However, I haven’t found any information on how to use PO tokens with spotdl.
Steps to reproduce - Ensure to include actual links!
https://github.com/yt-dlp/yt-dlp/wiki/Extractors#po-token-guide This command worked well for me on ytdlp --extractor-args “youtube:player_client=web_music,default;po_token=web_music+TOKENGOESHERE” the only hard part is to get po token.
Traceback
C:\Users\Documents\xxx>spotdl --cookie-file "C:\Users\Documents\xxx" "https://spotifyt.com/playlist/xxxxxx"
Processing query: https://spotifyt.com/playlist/xxxxx
Found 10 songs in Playlist Name (Playlist)
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=1gAd54gVyH4
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=DW0PTHJE0ao
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=yOOwcvl3u9Y
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=AyJM7N39tBU
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=p7pQf0WETEk
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=pb57CTmOFF0
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=_uG2bjb4mLs
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=cAqWW_HBmTM
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=mcE0NO7s7RE
AudioProviderError: YT-DLP download error - https://youtubexx.com/watch?v=LRcfqKqzxL
C:\Users\Documents\xxx>
C:\Users\Documents\xxx>spotdl "https://spotifyt.com/playlist/xxxx"
Processing query: https://spotifyt.com/playlist/xxxxx
Found 10 songs in Playlist Name (Playlist)
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=p7pQf0WETEk
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=DW0PTHJE0ao
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=yOOwcvl3u9Y
Total 3/10 complete ---------------- ------------------------------ 36% 0:00:29
Song Name - Track Title Processing ----------------------------------------------- 0% -:--:--
Song Name - Track Title Converting --------------------------- ------------------- 59% 0:ToToToToT
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=1gAd54gVyH4
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=LRcfqKqzxL0
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=mcE0NO7s7RE
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=AyJM7N39tBU
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=_uG2bjb4mLs
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=cAqWW_HBmTM
Downloaded "Song Name - Track Title": https://youtubexx.com/watch?v=pb57CTmOFF0
Other details
No response
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 19
- Comments: 36
This works! I cloned the spotdl repro and checked out @Kyrluckechuck’s branch, installed using pip and added the
--yt-dlp-args "--extractor-args \"youtube:player_client=web_music,default;po_token=web_music+<po_token>\""flag to my workflow and it completely fixed the problem for me. I’ve grabbed 6 albums so far and all files have a bit rate of 256k.Update: I ended up downloading another 50 albums and looks like I’ve received a temporary account ban from youtube music/youtube. This was nice while it lasted but no longer seems worth it.
Unfortunately running into this issue as well, and the annoying part is there is no indication that it is failing or ability to stop it from downloading a lesser-quality file. Would be nice if when this is resolved to also add a config option to “fail” if premium quality isn’t available
Not working for me too Bitrate stays on 128kb or lower
Getting the same error AudioProviderError
It doesnt work for me. My account is not banned and only shows “AudioProviderError: YT-DLP download error” with any config
@dunsparth @harksha @rinotaur007
I checked again today and it works fine with my branch - https://github.com/temporaryna/spotify-downloader I’ve got the same error just when cookie and token are old, so make sure you update all
command I used:
right before running this script
the cookie plugin I used -
Get cookies.txt LOCALLYfrom chrome extensions storeThe downloads are capped at 128 kbps, even after adding the POT token and cookies as instructed. This happens not only on the main branch but also on @Kyrluckechuck’s branch.
Ran into this issue, can confirm this command worked for me on @Kyrluckechuck’s branch (running on Ubuntu 24.04):
Keep in mind you’ll need to get a PO token and replace the
<token>bit in the command. I found out how to grab the PO token here.Cheers @Kyrluckechuck
@temporaryna ah turns out I was incorrect, it’s completely supported by my PR. No need for new
--extractor-args, it is supported by the existing--yt-dlp-argsafter the change I make in the PR to whitelist the parameter.Example usage:
@Kyrluckechuck I tried to use your branch with CLI but got error
spotdl: error: unrecognized arguments: --extractor-argscould you please write the command example that you are using for this?