How To Download A Playlist On Spotify
Spotify-Downloader
-
Downloads songs from YouTube in an MP3 format past using Spotify's HTTP link.
-
Tin likewise download a song by entering its artist and song name (in instance if you lot don't have the Spotify'southward HTTP link for some song).
-
Automatically applies metadata to the downloaded song which include:
- Title
- Artist
- Album
- Album art
- Lyrics (if found on http://lyrics.wikia.com)
- Album creative person
- Genre
- Track number
- Disc number
- Release appointment
- And more...
-
Works directly out of the box and does non require to generate or mess with your API keys.
That's how your music library volition wait like!
Installation
-
This tool supports only Python 3, Python 2 compatibility was dropped because of the way information technology deals with unicode. If you need to use Python ii though, bank check out the (old)
python2
branch. -
Note:
play
andlyrics
commands have been deprecated in the current co-operative since they were not of much utilize and created unnecessary clutter. You tin even so get them back by usingold
branch though.
Debian, Ubuntu, Linux & Mac
$ cd $ git clone https://github.com/ritiek/spotify-downloader $ cd spotify-downloader $ pip install -U -r requirements.txt
Important: if yous have installed both Python ii and 3, the pip
control could invoke an installation for Python ii. To see which Python version pip
refers to, try $ pip -Five
. If information technology turns out pip
is your Python 2 pip, try $ pip3 install -U -r requirements.txt
instead.
Yous'll besides need to install FFmpeg for conversion (use --avconv
if you lot'd like to use that instead):
Linux: $ sudo apt-get install ffmpeg
Mac: $ mash install ffmpeg --with-libmp3lame --with-libass --with-opus --with-fdk-aac
If information technology does not install correctly, you may have to build it from source. For more info see https://trac.ffmpeg.org/wiki/CompilationGuide.
Windows
Bold yous have Python iii (preferably v3.6 or above to stay abroad from Unicode errors) already installed and in PATH.
-
Download and extract the zip file from master co-operative.
-
Download FFmpeg for Windows from here. Copy
ffmpeg.exe
fromffmpeg-30-winxx-static\bin\ffmpeg.exe
to PATH (usually C:\Windows\System32) or just place it in the root directory extracted from the in a higher place pace. -
Open
cmd
and type$ pip install -U -r requirements.txt
to install dependencies. The aforementioned annotation aboutpip
as for Debian, Ubuntu, Linux & Mac applies.
Instructions for Downloading Songs
Of import: as like with pip
, in that location might be no $ python3
command. This is most likely the case when yous take only Python 3 only not 2 installed. In this case try the $ python
command instead of $ python3
, but make sure $ python -V
gives you a Python 3.x.ten
!
- For all available options, run
$ python3 spotdl.py --help
.
usage: spotdl.py [-h] (-s Vocal | -fifty LIST | -p PLAYLIST | -b Anthology | -u USERNAME) [-m] [-nm] [-a] [-f Folder] [--overwrite {strength,prompt,skip}] [-i INPUT_EXT] [-o OUTPUT_EXT] [-ff] [-dm] [-d] [-mo] [-ns] [-ll {INFO,Alert,ERROR,DEBUG}] Download and convert songs from Spotify, Youtube etc. optional arguments: -h, --help bear witness this assist bulletin and exit -southward Song, --song SONG download song by spotify link or name (default: None) -l LIST, --listing LIST download songs from a file (default: None) -p PLAYLIST, --playlist PLAYLIST load songs from playlist URL into <playlist_name>.txt (default: None) -b Album, --anthology ALBUM load songs from anthology URL into <album_name>.txt (default: None) -u USERNAME, --username USERNAME load songs from user's playlist into <playlist_name>.txt (default: None) -chiliad, --transmission choose the song to download manually (default: Simulated) -nm, --no-metadata practice non embed metadata in songs (default: Fake) -a, --avconv Use avconv for conversion otherwise set up defaults to ffmpeg (default: Faux) -f FOLDER, --folder Folder path to folder where files will be stored in (default: Music) --overwrite {force,prompt,skip} change the overwrite policy (default: prompt) -i INPUT_EXT, --input-ext INPUT_EXT prefered input format .m4a or .webm (Opus) (default: .m4a) -o OUTPUT_EXT, --output-ext OUTPUT_EXT prefered output extension .mp3 or .m4a (AAC) (default: .mp3) -ff, --file-format File format to salve the downloaded song with, each tag is surrounded by curly braces. Possible formats: ['track_name', 'artist', 'anthology', 'album_artist', 'genre', 'disc_number', 'duration', 'twelvemonth', 'original_date', 'track_number', 'total_tracks', 'isrc'] (default: {artist} - {track_name}) -dm, --download-just-metadata download songs for which metadata is found (default: False) -d, --dry-run Show only rail title and YouTube URL (default: Simulated) -mo, --music-videos-merely Search merely for music on Youtube (default: False) -ns, --no-spaces Replace spaces with underscores in file names (default: False) -ll {INFO,Alarm,Mistake,DEBUG}, --log-level {INFO,Alert,Mistake,DEBUG} gear up log verbosity (default: INFO) -c CONFIG_FILE_PATH --config CONFIG_FILE_PATH Supercede with custom config.yml file (default: None)
Download by Proper name
For example
-
We want to download Fade past Alan Walker, simply run
$ python3 spotdl.py --vocal "alan walker fade"
. -
The script will automatically look for the all-time matching vocal and download it in the binder
Music/
placed in the root directory of the lawmaking base. -
It will at present convert the song to an mp3 and try to fix meta-tags and album-art by looking up on Spotify.
Download by Spotify Link (Recommended)
For example
-
We desire to download the same song (i.e: Fade by Alan Walker) but using Spotify Link this time that looks like
https://open.spotify.com/track/2lfPecqFbH8X4lHSpTxt8l
, you can copy it from your Spotify desktop or mobile app past right clicking or long tap on the vocal and copy HTTP link. -
Run
$ python3 spotdl.py --song https://open.spotify.com/rails/2lfPecqFbH8X4lHSpTxt8l
, it should download Fade by Alan Walker. -
But similar before, information technology volition again convert the song to an mp3 but since we used a Spotify HTTP link, the script is guaranteed to fetch the correct meta-tags and album-art.
Download by File
For case
- We want to download
Fade by Alan Walker
,Sky Loftier by Elektromania
andFire by Elektromania
only using a single command.
Let's suppose, we take the Spotify link for only Fade by Alan Walker
and Burn by Elektromania
.
No trouble!
- Just make a
list.txt
in the same folder as the script and add all the songs you lot want to download, in our instance it is
(if you are on Windows, just edit list.txt
- i.e C:\Python36\spotify-downloader-master\listing.txt
)
https://open up.spotify.com/track/2lfPecqFbH8X4lHSpTxt8l elektromania sky high https://open.spotify.com/track/0fbspWuEdaaT9vfmbAZr1C
-
Now pass
--list=list.txt
to the script, i.e$ python3 spotdl.py --list=list.txt
and information technology will start downloading songs mentioned inlist.txt
. -
Y'all tin stop downloading songs by hitting
ctrl+c
, the script volition automatically resume from the song where you stopped it the next time you lot want to download the songs present inlist.txt
. -
Songs that are already downloaded will prompt you to overwrite or skip. This behavior tin can be changed by passing
--overwrite {prompt,skip,forcefulness}
.
Download by Playlist Link
- Yous can copy the Spotify URL of the playlist and pass it in
--playlist
option. Note: This method works for public likewise every bit individual playlists.
For instance
-
$ python3 spotdl.py --playlist https://open.spotify.com/user/nocopyrightsounds/playlist/7sZbq8QGyMnhKPcLJvCUFD
-
The script will load all the tracks from the playlist into
<playlist_name>.txt
-
Then you tin simply run
$ python3 spotdl.py --list=<playlist_name>.txt
to download all the tracks.
Download by Album Link
- You tin copy the Spotify URL of the album and pass information technology in
--album
option.
For instance
-
$ python3 spotdl.py --album https://open.spotify.com/album/499J8bIsEnU7DSrosFDJJg
-
The script volition load all the tracks from the anthology into
<album_name>.txt
-
Then you tin just run
$ python3 spotdl.py --list=<album_name>.txt
to download all the tracks.
Download by Username
-
Y'all can likewise load songs using Spotify username if yous don't have the playlist URL. (Open contour in Spotify, click on the three little dots beneath name, "Share", "Copy to clipboard", paste last numbers or text into command-line:
https://open.spotify.com/user/0123456790
) -
Try running
python3 spotdl.py -u <your_username>
, information technology volition (only) evidence all your public playlists (which excludes collaborative and private playlists). -
Once you select the one you desire to download, the script will load all the tracks from the playlist into
<playlist_name>.txt
. -
Run
$ python3 spotdl.py --list=<playlist_name>.txt
to download all the tracks.
Specify the Target Directory
If you don't want to download all the songs to the Music/
folder relative to the spotdl.py
script, you can utilize the -f
/--folder
choice. E.g. $ python3 spotdl.py -s "adele hello" -f "/domicile/user/Music/"
. This works with both relative and absolute paths.
Config File
At first run, this tool volition generate a config.yml
in root directory of the code base with default options. You can so alter config.yml
to override any default options.
Likewise note that config options are overridden by control-line arguments.
If you desire to use custom .yml
configuration instead of the default one, you can use -c
/--config
option. E.g. $ python3 spotdl.py -south "adele hello" -c "/abode/user/customConfig.yml"
Set YouTube API Central
By default this tool volition scrape YouTube to fetch for matching video tracks. Nonetheless, you can optionally use YouTube API for faster response time. To do this, generate your API key and so fix it in your config.yml
.
Docker Image
We likewise provide the latest docker paradigm on DockerHub.
-
Pull (or update) the image with
$ docker pull ritiek/spotify-downloader
. -
Run it with
$ docker run --rm -it -five $(pwd):/music ritiek/spotify-downloader <arguments>
. -
The container will download music and write tracks in your electric current working directory.
Example - Downloading a Playlist
$ docker run --rm -it -v $(pwd):/music ritiek/spotify-downloader -p https://open up.spotify.com/user/nocopyrightsounds/playlist/7sZbq8QGyMnhKPcLJvCUFD $ docker run --rm -it -v $(pwd):/music ritiek/spotify-downloader -fifty ncs-releases.txt
Get out Codes
-
0
- Success -
1
- Unknown error -
2
- Command line fault (due east.thou. invalid args) -
3
-KeyboardInterrupt
-
10
- Invalid playlist URL -
xi
- Playlist not institute
Contributing
Check out CONTRIBUTING.physician for more than info.
Running Tests
Patently this requires the pytest
module to be installed.
Disclaimer
Downloading copyright songs may be illegal in your land. This tool is for educational purposes only and was created but to show how Spotify's API can exist exploited to download music from YouTube. Please back up the artists by buying their music.
License
Source: https://githubhelp.com/vldxg/spotify-downloader
Posted by: johnsonbrin1966.blogspot.com
0 Response to "How To Download A Playlist On Spotify"
Post a Comment