A Python script to download songs/albums/playlists directly from Spotify in 256kbps/128kbps AAC.
- Install Python 3.7 or newer
- Install spotify-aac-downloader with pip
pip install spotify-aac-downloader - Add mp4decrypt and ffmpeg to your PATH
- You can get them from here:
- mp4decrypt: https://www.bento4.com/downloads/
- ffmpeg: https://ffmpeg.org/download.html
- You can get them from here:
- Export your Spotify cookies as
cookies.txtto the same folder that you will run the script- You can export your cookies by using this Google Chrome extension on Spotify website: https://chrome.google.com/webstore/detail/open-cookiestxt/gdocmgbfkjnnpapoeobnolbbkoibbcif. Make sure to be logged in.
- Put your Widevine Device file (.wvd) in the same folder that you will run the script
- You can use Dumper to dump your phone's L3 CDM: https://github.com/Diazole/dumper. Once you have the L3 CDM, you can use pywidevine to create the .wvd file from it.
- Install pywidevine with pip
pip install pywidevine pyyaml - Create the .wvd file
pywidevine create-device -t ANDROID -l 3 -k private_key.pem -c client_id.bin -o .
- Install pywidevine with pip
- You can use Dumper to dump your phone's L3 CDM: https://github.com/Diazole/dumper. Once you have the L3 CDM, you can use pywidevine to create the .wvd file from it.
usage: spotify-aac-downloader [-h] [-u [URLS_TXT]] [-f FINAL_PATH] [-t TEMP_PATH] [-c COOKIES_LOCATION] [-w WVD_LOCATION] [-n]
[-p] [-o] [-s] [-e] [-v]
[<url> ...]
Download songs/albums/playlists directly from Spotify in AAC
positional arguments:
<url> Spotify song/album/playlist URL(s) (default: None)
options:
-h, --help show this help message and exit
-u [URLS_TXT], --urls-txt [URLS_TXT]
Read URLs from a text file (default: None)
-f FINAL_PATH, --final-path FINAL_PATH
Final Path (default: Spotify)
-t TEMP_PATH, --temp-path TEMP_PATH
Temp Path (default: temp)
-c COOKIES_LOCATION, --cookies-location COOKIES_LOCATION
Cookies location (default: cookies.txt)
-w WVD_LOCATION, --wvd-location WVD_LOCATION
.wvd file location (default: *.wvd)
-n, --no-lrc Don't create .lrc file (default: False)
-p, --premium-quality
Download 256kbps AAC instead of 128kbps AAC (default: False)
-o, --overwrite Overwrite existing files (default: False)
-s, --skip-cleanup Skip cleanup (default: False)
-e, --print-exceptions
Print execeptions (default: False)
-v, --version show program's version number and exit