Download music from YouTube, YouTube Music and Soundcloud,
with great metadata and little effort.
You need to have:
- python (3.11+) installed
- ffmpeg installed (See Installing ffmpeg) and added to PATH, or specify it with --ffmpeg-location/config
Installation methods:
1. uv (preferred) -> install uv, then run:
bash
uv tool install shiradl
2. pipx -> install pipx, then run:
bash
pipx install shiradl
3. local installation with uv (for development) - see Contributing
If you don't want to install shira and just want to try it out / use it once, run
uvx shiradl <args>
If you have previously installed shira, it's important to update it to the last version, otherwise it may not work.
- uv: uv tool upgrade shiradl
- pipx: pipx upgrade shiradl --pip-args='--upgrade-strategy=eager'
Guides: Using a cookies file, Troubleshooting
shiradl https://music.youtube.com/watch?v=HdX2COsY2Xk YouTube Musicshiradl "https://music.youtube.com/watch?v=8YwKlPH93Ps&list=PLC1og_v3eb4jE0bmdkWtizrSQ4zt86-3D"shiradl https://www.youtube.com/watch?v=X0-AvRA7kB0 YouTube (video)shiradl https://soundcloud.com/neffexmusic/fight-back SoundCloudshiradl https://music.youtube.com/playlist?list=PLC1og_v3eb4jE0bmdkWtizrSQ4zt86-3D Album/Playlistshiradl -u ./links.txt List of links to downloadtitle, channel_name, description, upload_date, etc.m4a (iTunes) and .mp3 (ID3v2.4) tags with mediafiletrack, album, artist, albumartist idsartist, albumartist if this recording can't be found, but artist can.IDOL【ENGLISH EDM COVER】「アイドル」 by ARTIST【Artist1 x @Artist2 】 =>IDOL [ENGLISH EDM COVER] [アイドル] by ARTISTMore info about YouTube thumbnail to Album Art algorithm
inline-snapshot, because otherwise shira probably wouldn't have tests. :)
Any donations are highly appreciated! <3
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 |
The following itags are available:
- 140 (128kbps AAC) - default, because it's the result of bestaudio/best on a free account
- 141 (256kbps AAC) - use if you have premium alongside --cookies-location
- 251 (128kbps Opus) - most stuff will error with Failed to check URL 1/1. Better to use 140
SoundCloud will always download in 128kbps MP3
- SoundCloud also offers OPUS, which is currently not supported. Some people were complaining that the quality is worse
- These are questionable claims at best, but better safe than sorry.
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
To exclude all musicbrainz tags, you can add mb* to exclude_tags. (This does not work for other types of tags).
Can be either jpg or png.
https://soundcloud.com/yatashi-gang-63564467/lovely-bastards-yatashigang => lovely-bastards-yatashigang.jpg / .pngyt-dlp or something else needs updatinguv tool install git+https://github.com/KraXen72/shirapipx install git+https://github.com/KraXen72/shirauvx --from git+https://github.com/KraXen72/shira shiradl <args> (doesn't install, only runs)python: No module named shiradl shiradl directory, e.g. /shira/shiradl. if yes, move up one directory with cd .. and retry.python 3.8+ and updating to 3.11+ is not an optionuv add typing-extensions and modify tagging.py accordingly:
```diffIf you're uninstalling because shira doesn't work, I would like to kindly ask you to please make a GitHub issue about what exactly doesn't work. Thanks!
To uninstall, run the appropriate command. If unsure which way you installed shira, run both.
- uv: uv tool uninstall shiradl
- pipx: pipx uninstall shiradl
scoop install main/ffmpegscoop update and scoop update ffmpeg/*C:\ffmpeg. It's best if the path doesn't have spaces.Edit the system environment variables in the Start Menu, launch it.Path user variable, click EditNew on the side and enter the path to the ffmpeg\bin folder which has ffmpeg.exe in it, e.g. C:\ffmpeg\binOk. To verify that ffmpeg is installed, run ffmpeg -version in the terminal.ffmpeg to path, you can point to it manually.ffmpeg_location or the cli flag --ffmpeg-location to point to the ffmpeg.exe file.ffplay.exe and ffprobe.exe files in the same directory.ffmpeg - $ claude mcp add shira \
-- python -m otcore.mcp_server <graph>