KraXen72 / shira

Download music from YouTube, YouTube Music and Soundcloud, with great metadata and little effort.
MIT License
60 stars 3 forks source link

shira

A smart music downloader

Download music from YouTube, YouTube Music and Soundcloud,
with great metadata and little effort.

Installation

On some systems, you might have to use the python3 or python3.x command instead of python
Guides: Using a cookies file, Troubleshooting

Usage Examples

Goals

Tagging

More info about YouTube thumbnail to Album Art algorithm
  1. samples 4 pixels near the corners of the thumbnail (which is first smoothed and reduced to 64 colors)
  2. decides to crop if average of standard deviations of r, g and b color channels from each sample point is lower than a than a treshold
  3. otherwise pads the image to 1:1 with it's dominant color

About & Credits

Support development

Recurring donation via Liberapay One-time donation via ko-fi.com
Any donations are highly appreciated! <3

Configuration

Shira can be configured using the command line arguments or the config file.
The config file is created automatically when you run shira for the first time at ~/.shiradl/config.json on Linux and %USERPROFILE%\.shiradl\config.json on Windows. Config file values can be overridden using command line arguments.

Command line argument / Config file key Description Default value
-f, --final-path / final_path Path where the downloaded files will be saved. ./YouTube Music
-t, --temp-path / temp_path Path where the temporary files will be saved. ./temp
-c, --cookies-location / cookies_location Location of the cookies file. null
--ffmpeg-location / ffmpeg_location Location of the FFmpeg binary. ffmpeg
--config-location / - Location of the config file. <home folder>/.shiradl/config.json
-i, --itag / itag Itag (audio quality/format). More info 140
--cover-size / cover_size Size of the cover. size >= 0 and <= 16383 1200
--cover-format / cover_format Format of the cover. jpg or png jpg
--cover-quality / cover_quality JPEG quality of the cover. [1<=x<=100] 94
--cover-img / cover_img Path to image or folder of images. More info null
--cover-crop / cover_crop 'crop' takes a 1:1 square from the center, pad always pads top & bottom. auto, crop or pad auto - More info
--template-folder / template_folder Template of the album folders as a format string. {albumartist}/{album}
--template-file / template_file Template of the track files as a format string. {track:02d} {title}
-e, --exclude-tags / exclude_tags List of tags to exclude from file tagging separated by commas without spaces. null
--truncate / truncate Maximum length of the file/folder names. 40
-l, --log-level / log_level Log level. INFO
-s, --save-cover / save_cover Save cover as a separate file. false
-o, --overwrite / overwrite Overwrite existing files. false
-p, --print-exceptions / print_exceptions Print exceptions. false
-u, --url-txt / - Read URLs as location of text files containing URLs. false
-n, --no-config-file / - Don't use the config file. false
-w, --single-folder / - Wrap singles in their own folder instead of placing them directly into artist's folder. false

Itags

The following itags are available:

SoundCloud will always download in 128kbps MP3

Tag variables

The following variables can be used in the template folder/file and/or in the exclude_tags list:
title, album, artist, albumartist, track, tracktotal, year, date, cover, comments, lyrics, media_type, rating, track, tracktotal, mb_releasetrackid, mb_releasegroupid, mb_artistid, mb_albumartistid

Cover formats

Can be either jpg or png.

Cover img

Troubleshooting

Installing ffmpeg

Installing ffmpeg with scoop

Setting a cookies file

Contributing