This is currently WIP, whilst the CLI mode is mostly feature complete, some bugs may still be present. Fixes, Improvements, and cross-platform testing still to come!
Prior to starting this project, I used a small collection of bash scripts that I had built over some time. These would allow me to call yt-dlp, and then batch fix the .mp3 meta data, using eyeD3. This would look something like:
getmusic https://music.youtube.com/playlist..... [*]These scripts work, but are very tailored to my specific use case, and I had yet to get around to adding proper arg parsing etc. As an example, adding literally any value after the URL, would skip prompting the Artist name, and instead use the name of the CWD, subbing _ to spaces.
In comparison to my old scripts, omusic is the refined successor, written in Odin. All of the same functionality, and then some, packaged in a single binary. It will, eventually, have a GUI mode to accompany the CLI usage. Using omusic would look something like:
omusic -u https://music.youtube.com/playlist.... [opts / flags]-
-u / --url *
-
-o / --output *
-
-a / --artist
-
-ab / --album
-
-t / --title
Options that are not provided, will be prompted on execution (unless --no-prompt is passed)
If config:allow_make_destination is set to false, the value of --output is checked. Should the destination path not contain your user home directory, it will be automatically prefixed, with your current working directory. Note, this behaviour is skipped entirely, if allow_make_destination is true.
- -uf / --use-ftitle
- -ud / --use-dir-artist
- -nf / --no-fix
- -np / --no-prompt
- -i / --interactive
--use-ftitle will skip prompting for option:title, and instead use the file name (after clean up), replacing all underscores, with spaces
--use-dir-artist will skip prompting for option:artist, and instead use the directory name of the option:output, replacing all underscores, with spaces
--no-fix will skip the filename cleanup, leaving all downloaded file names intact
--interactive will launch omusic in GUI mode (Currently just a raylib window) This flag can be used without the use of any other options/flags
Files downloaded from yt music will look something like:
R.I.P. (feat. Skylar Grey) [HBySjaPAA7k].mp3Currently, the default behaviour is to first search for any instance of '('. If not found, omusic instead jumps to the '[', and trims from there.
Next, using trim_from_filename array, from the config file, omusic will strip out any listed characters
Note: currently there is no way to toggle seeking the '(', this will soon be controllable via a bool in the config file
omusic uses a config file (generated on first run) here:
$HOME/.config/omusic/config.jsonWhilst most behaviours are set during the call to omusic, when ran in CLI mode, some are only configurable via the config.json. These values include:
- default_dir: Refers to the default destination, if one is not provided
- use_pywal: This setting is ignored if using pywal is not supported on your system
- trim_from_filename: List of characters to be purged from the filename of downloads
- allow_make_destination: Whether or not to create destination, or exit if it does not exist
- win_bg: Default window colour in GUI Mode, when not using pywal
If you are a Linux user, and have wal installed, omusic will automatically attempt to use the colours found in:
$HOME/.cache/wal/colors-rgbThis can be disabled via the use_pywal bool in the config file. Note, this will be disregarded if omusic cannot find wal, or detects an OS other than Linux
You can update omusic colours with:
kill -USR1 omusicAnd reload the config with:
kill -USR2 omusic