Skip to main content

A Python CLI app for downloading songs and music videos directly from Spotify.

Project description

Spotify Web Downloader

A Python CLI app for downloading songs and music videos directly from Spotify.

Discord Server: https://discord.gg/aBjMEZ9tnq

Features

  • Download songs in AAC 128kbps or in AAC 256kbps with a premium account
  • Download synced lyrics
  • Download music videos with a premium account
  • Highly configurable

Prerequisites

Installation

  1. Install the package spotify-web-downloader using pip
    pip install spotify-web-downloader
    
  2. Place your cookies file in the directory from which you will be running spotify-web-downloader and name it cookies.txt.

Usage

spotify-web-downloader [OPTIONS] URLS...

Examples

  • Download a song
    spotify-web-downloader "https://open.spotify.com/track/18gqCQzqYb0zvurQPlRkpo"
    
  • Download an album
    spotify-web-downloader "https://open.spotify.com/album/0r8D5N674HbTXlR3zNxeU1"
    

Configuration

spotify-web-downloader can be configured using the command line arguments or the config file.

The config file is created automatically when you run spotify-web-downloader for the first time at ~/.spotify-web-downloader/config.json on Linux and %USERPROFILE%\.spotify-web-downloader\config.json on Windows.

Config file values can be overridden using command line arguments.

Command line argument / Config file key Description Default value
--download-music-video / download_music_video Attempt to download music videos from songs (can lead to incorrect results). false
--save-cover, -s / save_cover Save cover as a separate file. false
--overwrite / overwrite Overwrite existing files. false
--read-urls-as-txt, -r / - Interpret URLs as paths to text files containing URLs. false
--lrc-only, -l / lrc_only Download only the synced lyrics. false
--no-lrc / no_lrc Don't download the synced lyrics. false
--config-path / - Path to config file. <home>/.spotify-web-downloader/config.json
--log-level / log_level Log level. INFO
--print-exceptions / print_exceptions Print exceptions. false
--cookies-path, -c / cookies_path Path to .txt cookies file. ./cookies.txt
--output-path, -o / output_path Path to output directory. ./Spotify
--temp-path / temp_path Path to temporary directory. ./temp
--wvd-path / wvd_path Path to .wvd file. null
--ffmpeg-path / ffmpeg_path Path to FFmpeg binary. ffmpeg
--mp4box-path / mp4box_path Path to MP4Box binary. MP4Box
--mp4decrypt-path / mp4decrypt_path Path to mp4decrypt binary. mp4decrypt
--aria2c-path / aria2c_path Path to aria2c binary. aria2c
--nm3u8dlre-path / nm3u8dlre_path Path to N_m3u8DL-RE binary. N_m3u8DL-RE
--remux-mode / remux_mode Remux mode. ffmpeg
--date-tag-template / date_tag_template Date tag template. %Y-%m-%dT%H:%M:%SZ
--exclude-tags / exclude_tags Comma-separated tags to exclude. null
--truncate / truncate Maximum length of the file/folder names. null
--template-folder-album / template_folder_album Template of the album folders as a format string. {album_artist}/{album}
--template-folder-compilation / template_folder_compilation Template of the compilation album folders as a format string. Compilations/{album}
--template-file-single-disc / template_file_single_disc Template of the song files for single-disc albums as a format string. {track:02d} {title}
--template-file-multi-disc / template_file_multi_disc Template of the song files for multi-disc albums as a format string. {disc}-{track:02d} {title}
--download-mode-song / download_mode_song Download mode for songs. ytdlp
--premium-quality, -p / premium_quality Download songs in premium quality. false
--template-folder-music-video / template_folder_music_video Template of the music video folders as a format string. {artist}/Unknown Album
--template-file-music-video / template_file_music_video Template of the music video files as a format string. {title}
--download-mode-video / download_mode_video Download mode for videos. ytdlp
--no-config-file, -n / - Do not use a config file. false

Tag variables

The following variables can be used in the template folder/file and/or in the exclude_tags list:

  • album
  • album_artist
  • artist
  • compilation
  • composer
  • copyright
  • cover
  • disc
  • disc_total
  • isrc
  • label
  • lyrics
  • media_type
  • producer
  • rating
  • release_date
  • release_year
  • title
  • track
  • track_total
  • url

Remux modes

The following remux modes are available:

Music videos quality

Music videos will be downloaded in the highest quality available in H.264/AAC, up to 1080p.

Download modes

The following modes are available for songs:

The following modes are available for videos:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spotify_web_downloader-1.7.2.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

spotify_web_downloader-1.7.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file spotify_web_downloader-1.7.2.tar.gz.

File metadata

File hashes

Hashes for spotify_web_downloader-1.7.2.tar.gz
Algorithm Hash digest
SHA256 3158c6a23c3c1d57cd4eb056a4abad135ccb8ce0bf825f4c58c92746a8c14043
MD5 e2f85b97939e9abba51a6d4b93ace0a7
BLAKE2b-256 03ca4e62115b78cee75d5e812e55e499196262ee6aa3b29f1c99df4491fb9340

See more details on using hashes here.

File details

Details for the file spotify_web_downloader-1.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for spotify_web_downloader-1.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27a7e97818a5f4a9d4c6c921fb4b0c38e16fddebf020d67f547b98c78eb3afb3
MD5 02441bff0dcf32bd85130eb3fd5c603e
BLAKE2b-256 1e02a9ec4ef3caee833aea0d75103cdf6ce97ea70b1838b8812c730e3fbcc6ae

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page