Package: savify
SavifySavifyis a python
library that downloads songs from a selected provider (by default YouTube),
and then scrapes the meta information from Spotify. Given a query, Savify will find
and download songs to mp3 format with quality as high as320 kb/s!
The application will also scrape and writeid3v2 tagsto all your
songs. Tags includetitle, artists, year, album and even cover-art!Savify supports all Spotify track, album, and playlist links. Additionally,
there is anintegrated search functionso even if you do not have the
Spotify link you can simply enter song name and Savify will download it!As well as mp3, Savify can also download and convert to other file types.
Inside the application, you can specify which format and quality you would
like to download the song in for maximum compatibility across all your
devices. Available formats: mp3, aac, flac, m4a, opus, vorbis, and wav.Tags and cover art will only be applied to songs downloaded in mp3 format.Please note this library does not go against Spotify TOS in any way, songs
are not ripped directly from Spotify, but are instead downloaded from other
sources such as YouTube and Soundcloud using the youtube-dl python library.
Spotify is only used to gather accurate meta information to be embedded into
the downloaded song files.Any questions or feedback join theDiscord ServerFFmpegSavify relies on the open source FFmpeg library to convert and
write metadata to the songs it downloads. Please make sure FFmpeg is
installed on your computer and added to the System PATH. Follow the tutorialhere.PlaylistsIf you want to use Savify to download personal Spotify playlists, ensure their
visibility is set to ‘Public’. This is so Savify can use the Spotify API to
retrieve the song details from your playlist.InstallationIf you are on Windows you can download the latest pre-packed executable
package (which I recommend as you will not have to provide a Savify API key),
or you can download the python library and run the module directly using the CLI.Download the latest releaseGohereto download
the latest Savify.exe then make sure you have:FFmpeg downloaded and it added to your PathSpotify API credentials added to your environment variablesThat is it, you should be good to go! See some usage examples below.Using the Python module$ pip install-UsavifyUsageCurrently Savify only supports Spotify URLs and search queries,
however support for Spotify URIs will be added in the future.CLIIf you have downloaded the latest Savify.exe from the releases page
open your terminal and navigate to the same directory as the binary,
then you can run:$ Savify.exeIf you are using the Python package and savify is installed to your
site-packages and your pip folder is in your PATH (which it should be
by default), from anywhere you can simply run:$ savifyFor help run:$ savify--helpGeneral usageUsing the default above:$ savify"https://open.spotify.com/track/4Dju9g4NCz0LDxwcjonSvI"Specifying your own options:$ savify"https://open.spotify.com/track/4Dju9g4NCz0LDxwcjonSvI"-qbest-fmp3-o"/path/to/downloads"-g"%artist%/%album%"With a search query:$ savify "You & I -Bru-C"-ttrack-qbest-fmp3-o"/path/to/downloads"-g"%artist%/%album%"GroupingAvailable variables:%artist%, %album%, %playlist%For example:$ savify "You & I -Bru-C"-o/path/to/downloads-g"%artist%/%album%"Would download in the following directory structure:/path/to/downloads||-/Bru-C||-/OriginalSounds||-Bru-C-You&I.mp3Download DefaultsQuery Type:trackQuality:bestFormat:mp3Path:Windows: HOME/AppData/Roaming/Savify/downloadsLinux: HOME/.local/share/Savify/downloadsMacOS: HOME/Library/Application Support/Savify/downloadsGrouping:no groupingFor more usage examples read thedocs.Spotify ApplicationTo use the Savify Python module you will need your own Spotify
developer application to access their API. To do this sign uphere. When you have made a new
application take note of your client id and secret. You can pass
the id and secret to Savify in two ways:Environment variables (recommended)Now you need to add 2 environment variables to your system:SPOTIPY_CLIENT_IDSPOTIPY_CLIENT_SECRETTo find out how to do this find a tutorial online for your specific
operating system. Once you have done this make sure to restart your
shell.During object instantiationYou can pass in your id and secret using a tuple when creating your
Savify object:s=Savify(api_credentials=("CLIENT_ID","CLIENT_SECRET"))Use in your Python projectInstall the package to your environment:$ pip install savifyImport and use Savify:fromsavifyimportSavifyfromsavify.typesimportType,Format,Qualitys=Savify()# Spotify URLs.download("SPOTIFY URL")# Search Query# Types: TRACK, ALBUM, PLAYLISTs.download("QUERY",query_type=Type.TRACK)Savify optional constructor arguments (see above for defaults):importloggingfromsavifyimportSavifyfromsavify.typesimportType,Format,Qualityfromsavify.utilsimportPathHolder# Quality Options: WORST, Q32K, Q96K, Q128K, Q192K, Q256K, Q320K, BEST# Format Options: MP3, AAC, FLAC, M4A, OPUS, VORBIS, WAVSavify(api_credentials=None,quality=Quality.BEST,download_format=Format.MP3,path_holder=PathHolder(downloads_path='path/for/downloads'),group='%artist%/%album%',quiet=False,skip_cover_art=False,log_level=logging.INFO)Manually customising youtube-dl options:fromsavifyimportSavifyoptions={'cookiefile':'cookies.txt'}Savify(ydl_options=options)Passing in your own logger:fromsavifyimportSavifyfromsavify.loggerimportLoggerlogger=Logger(log_location='path/for/logs',log_level=None)# Silent outputSavify(logger=logger)The group argument is used to sort you downloaded songs inside the
output path. Possible variables for the path string are: %artist%, %album%,
and %playlist%. The variables are replaced with the songs metadata.
For example, a song downloaded with the above Savify object would
save to a path like this:path/for/downloads/Example Artist/Example Album/Example Song.mp3For DevelopersIf you want to try your hand at adding to Savify use the instructionshere. From there you can make any additions you
think would make Savify better.TipIf you are developing Savify, install the pip package locally so you
can make and test your changes. From the root directory run:$ pip install-e.You can then run the Python module:$ savifyCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.