A command line utility to download songs from youtube with metadata from different APIs without the need for API-tokens or login.
Project description
SomeDL - Song+Metadata Downloader
This is a simple commandline program to download music with the correct metadata. The audio is downloaded using yt-dlp. Metadata is fetched from YouTube, but also from different other sources, like MusicBrainz for genre, Genius for album info and Deezer for music label and isrc-codes. All these APIs work without the need for an API token, so you can use this application as is.
If you have any problems, feature requests, suggestions of improvements of any kind or even general questions, do not hesitate to open an issue here on GitHub. I am open to add functionality based on individual usecase.
Disclaimer: This project - although being fully functional - is primarily a way for me to learn the handling of APIs in python. This program is for educational purposes. This software is developed on Linux and tested on Linux & Windows.
Usage
Simply type somedl followed by your search query in quotes. You typically find
somedl "Nirvana - Smells like teen spirit"
You can also search by YouTube or YouTube music URL and even by YouTube playlist URL.
Installation
This utility can be installed using pip. Also confirm that you meet all the installation requirements!
Windows
pip install somedl
or
py -m pip install somedl
Linux
This software is currently not packaged in any packagemanager or third party repo. Use your prefered way to install pythograms, like for example pipx:
pipx install somedl
Requirements
Python (REQUIRED)
This program is developed and testet on the newest version of Python (currently 3.14). So python 3.14 would be recommended, although it probably also works on some older versions. Visit How to install python for a short guide.
FFmpeg (REQUIRED)
This program uses yt-dlp, which needs ffmpeg in order to convert the downloaded audio file to mp3. Visit How to install ffmpeg for a short guide.
Deno
It is also recommended to have Deno installed. yt-dlp needs deno to work properly (https://github.com/yt-dlp/yt-dlp/wiki/EJS). SomeDL should work without it, but yt-dlp will always print a warning.
- To install deno, go to https://docs.deno.com/runtime/getting_started/installation/
- If you have npm installed, you can use npm to install deno. If not, open PowerShell (not CMD!) and execute the command provided. (This downloads and installs a script, be aware to only do this from trusted sources!)
FAQ
Why does it download the wrong version of the song?
Rarely a "radio version" or similar has more views than the original version, meaning it is the first result that comes up and therefore the song that gets downloaded by SomeDL. Possible ways to get the correct song:
- Add e.g. "Original" to your search query, for example "Nirvana - Smells like teen spirit original". Sometimes this results in the correct song being downloaded.
- Search for the song on youtube music and download by URL. (IMPORTANT: Always use the link of the original soundtrack! Do not use the music video version, this does not have the correct metadata and audio track, so SomeDL has to search youtube again by artist name and song title, resulting in the same issue)
Why is the wrong genre/no genre set?
SomeDL gets the genre info from MusicBrainz (Neither YouTube nor Genius provide genre info via their APIs). The genre data on MusicBrainz is crowdsourced. Therefore, some artists may not have a genre set, some may have the wrong genre set. Everyone can create an account on MusicBrainz and vote for the genre (called „tags“). You are invited to do so and help make the database more complete. Please do so responsibly.
Genre info is added per artist to the song, meaning all songs of the same artist get the same genre. Music brainz does have genre tags per album and even per song, but since they are crowdsourced, they are often incomplete, so it is best to stick with the artists tags
How do i download age restricted songs?
You need to be logged into your age-verified YouTube account inside your browser. Then, append --cookies-from-browser firefox to your somedl command. This only works properly for non-chromium based browsers and i recommend to use firefox for this. For chromium based browsers, there is also the option of exporting a cookie file from your browser and appending that with --cookies "/path/to/file/cookies.txt. Only add these flags when downloading age restricted content. Heavy use of this application may lead to your account being banned when adding your browser cookies. This is a yt-dlp specific issue, visit their official documentation for more info. https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file somedl-0.2.0.tar.gz.
File metadata
- Download URL: somedl-0.2.0.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b483f1d55a02669fe9ee1727701ee22ef2883e17247d43252f0e4e3a962b1db6
|
|
| MD5 |
3adbc658896d885b5716c60de4057091
|
|
| BLAKE2b-256 |
8d0df8e62159e8d9fa0503918b740e73c1661dab895d78cb01393cd02d37a648
|
File details
Details for the file somedl-0.2.0-py3-none-any.whl.
File metadata
- Download URL: somedl-0.2.0-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e272165e51c2ddf12f00d7d0997ec19a4801bd2afd7af0ca7ea3bad2b42d3782
|
|
| MD5 |
8e1de5295bbd90fdd072c0a7ec636804
|
|
| BLAKE2b-256 |
f937c4374beff488f44694d807931c153a17852856b3fb0b839a08e40c2884f4
|