Muzlib is a Python script that allows you to create your own music library.
Project description
Muzlib
Muzlib is a Python script that allows you to create your own music library. Music is downloaded from YouTube, and music tags are constructed using data from YouTube, Lrclib, NetEase.
Instalation
Arch Linux [AUR]
You can install python-muzlib from AUR using your favorite AUR helper, for example:
yay -S python-muzlib
From PyPI
Ensure that you have installed FFmpeg.
python -m venv .venv
source .venv/bin/activate
pip install muzlib
Usage
Muzlib can be run directly from the command line. When launched without arguments, it starts an interactive prompt guiding you through the download process. You can also pass arguments to skip prompts entirely.
muzlib-cli [-h] [-l LIBRARY_PATH] [-d {album,artist,song}]
[--artist ARTIST] [--album ALBUM] [--song SONG]
[--non_interactive]
Arguments
| Argument | Short | Description |
|---|---|---|
--help |
-h |
Show help message and exit. |
--library_path PATH |
-l |
Root directory to save downloaded music. Defaults to your OS standard Music folder. |
--download_type {album,artist,song} |
-d |
Scope of the download: artist (full discography), album (specific release), or song (single track). |
--artist ARTIST |
Target artist's name. Highly recommended for all download types to ensure accurate search results. | |
--album ALBUM |
Target album's title. Use alongside --artist when --download_type is album. |
|
--song SONG |
Target song's title. Use alongside --artist when --download_type is song. |
|
--non_interactive |
Bypass all user prompts and automatically download the top search result. Requires --download_type to be set. |
Examples
Interactive mode
launches a menu to guide you through the download
muzlib-cli
Download an artist's full discography non-interactively
muzlib-cli -d artist --artist "Ludwig Göransson" --non_interactive
Download a specific album
muzlib-cli -d album --artist "Ludwig Göransson" --album "Oppenheimer" --non_interactive
Download a single song into a custom library folder
muzlib-cli -l ~/Music -d song --artist "Ludwig Göransson" --song "Can You Hear The Music" --non_interactive
[!NOTE]
--non_interactiverequires--download_typeto be specified, otherwise muzlib will exit with an error.
Available classes
There is only one (for now) class that can be used:
Muzlib(library_path: str, skip_downloaded=False): library class that uses YouTube Music metadata (100% accuracy, but sometimes poor quality metadata)
Available methods
Backup library
Muzlib.backup_library() -> str
This function creates backup of library (even with user-changed tags).
Creates file .muzlib/muzlib_backup_***.json and returns path to it.
Restore library
This function downloads track and set metadata from bacup file.
Muzlib.backup_library(backup_filepath: str)
backup_filepath: path of the file created byMuzlib.backup_library().
Troubleshooting
[!WARNING] If you encounter issues with yt-dlp, you can replace default cookies at
assets/cookies.txtas described at this guide.
Project details
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 muzlib-0.3.3.tar.gz.
File metadata
- Download URL: muzlib-0.3.3.tar.gz
- Upload date:
- Size: 28.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2305afccac469c8a896c52f905ab96f5fa4e5dedcbf7303e7e8a387f78c937e9
|
|
| MD5 |
c4ab26656b7b694207db5f663b0f17d6
|
|
| BLAKE2b-256 |
b9768e64aa90fc55cc9cf9da0f90388ff16cdedd55839e0f6ad0a3f0c0e82432
|
Provenance
The following attestation bundles were made for muzlib-0.3.3.tar.gz:
Publisher:
python-publish.yml on ezvezdov/muzlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muzlib-0.3.3.tar.gz -
Subject digest:
2305afccac469c8a896c52f905ab96f5fa4e5dedcbf7303e7e8a387f78c937e9 - Sigstore transparency entry: 1396749827
- Sigstore integration time:
-
Permalink:
ezvezdov/muzlib@0a9ad14ffb89d614833572965e87d5651f02bd0d -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ezvezdov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0a9ad14ffb89d614833572965e87d5651f02bd0d -
Trigger Event:
release
-
Statement type:
File details
Details for the file muzlib-0.3.3-py3-none-any.whl.
File metadata
- Download URL: muzlib-0.3.3-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1891a5626fb0dec6d0b66469ddf600f59b6ace83663bd038d94966ae36ca71c4
|
|
| MD5 |
4c471090ba0fd3a54370749023d61d8a
|
|
| BLAKE2b-256 |
7d3c2df0b0a31389b54ec439e482ccb60c32b1245f1fca173d73273cfdfc5d74
|
Provenance
The following attestation bundles were made for muzlib-0.3.3-py3-none-any.whl:
Publisher:
python-publish.yml on ezvezdov/muzlib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
muzlib-0.3.3-py3-none-any.whl -
Subject digest:
1891a5626fb0dec6d0b66469ddf600f59b6ace83663bd038d94966ae36ca71c4 - Sigstore transparency entry: 1396749832
- Sigstore integration time:
-
Permalink:
ezvezdov/muzlib@0a9ad14ffb89d614833572965e87d5651f02bd0d -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ezvezdov
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0a9ad14ffb89d614833572965e87d5651f02bd0d -
Trigger Event:
release
-
Statement type: