{"id":18878241,"url":"https://github.com/uriel1998/yolo-mpd","last_synced_at":"2025-08-03T21:39:20.886Z","repository":{"id":16705576,"uuid":"19462338","full_name":"uriel1998/yolo-mpd","owner":"uriel1998","description":"Various music-related tweaks/tips/scripts. Includes fuzzy selection of artist/genre/album script and albumart in the console script","archived":false,"fork":false,"pushed_at":"2025-05-08T08:45:56.000Z","size":3081,"stargazers_count":61,"open_issues_count":1,"forks_count":4,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-08T09:38:31.065Z","etag":null,"topics":["bash","cli","mpd"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uriel1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-05-05T16:19:00.000Z","updated_at":"2025-05-08T08:46:00.000Z","dependencies_parsed_at":"2022-09-05T02:51:17.769Z","dependency_job_id":"52a01024-ace1-4286-a12c-3ee6fa3f9657","html_url":"https://github.com/uriel1998/yolo-mpd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uriel1998%2Fyolo-mpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uriel1998%2Fyolo-mpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uriel1998%2Fyolo-mpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uriel1998%2Fyolo-mpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uriel1998","download_url":"https://codeload.github.com/uriel1998/yolo-mpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253786006,"owners_count":21964075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","cli","mpd"],"created_at":"2024-11-08T06:25:17.991Z","updated_at":"2025-05-12T17:26:14.769Z","avatar_url":"https://github.com/uriel1998.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"yolo-mpd\n========\n\nVarious MP3 and MPD tweaks, tips, tools, and scripts I've put together or found and tweaked.\n\n## Contents\n  1. [stream_to_mpd](stream_to_mpd)\n\n  2. [f_fix_covers](f_fix_covers)\n\n  3. [yad_show_mpd](yad_show_mpd)\n\n  4. [terminalcovers.sh](terminalcovers.sh)\n\n  5. [mpdcontrol.sh](mpdcontrol.sh)\n\n  6. [terminal-multiplexer](terminal-multiplexer)\n\n  7. [bpmhelper](bpmhelper)\n\n  8. [mp3gainhelper](mp3gainhelper)\n\n  9. [terminal_multiplexer](terminal_multiplexer)\n\n  10. [bpmhelper.sh](bpmhelper.sh)\n\n  11. [mp3gainhelper.sh](mp3gainhelper.sh)\n\n  12. [webserver.covers.sh](webserver.covers.sh)\n\n  13. [mediakey.sh](mediakey.sh)\n\n# stream_to_mpd  \n\nDependencies:  \n\n* [streamlink](https://streamlink.github.io/)  \n* `grep`, `awk`,`curl`,`wget`, and `zenity`, all likely included in your distro packaging.  \n\nFeed this utility a stream (including anything `streamlink` can handle, such as twitch music streamers) and it will pipe it through to your MPD server or save the stream URL in a file (such as an MPD playlist).  Uses `zenity` for gui dialogs if you do not specify elements on the commandline. Originally inspired by [this blog post](https://www.gebbl.net/2013/10/playing-internet-radio-streams-mpdmpc-little-bash-python/)\n\nUsage: `stream_to_mpd [OPTIONS] [STREAM_URL]`  \n\n`--host PASSWORD@HOST`: Needed if your MPD server is not on localhost or you have a password set  \n`--mpd` : skip right to MPD output  \n`--playlist` : skip right to adding stream URL to a file/playlist  \n`--native` : Throw the result to streamlink (probably not needed, but hey)  \n`--bookmarks` : use `zenity` to choose a hardcoded bookmark instead of a stream URL  \n\n# f_fix_covers\n\nThis is to finally fix those f'in covers in your music directory and to synchronize them between `cover.jpg`, `folder.jpg` and what's embedded in the file.   (Standard disclaimer: It worked on my system and files, I've done my best to catch edge cases, but backup your files first or use `--safe`.)\n\nIf they all match, it will ensure they're all the same. If one or more locations is missing the cover, it will add it there. (Including embedded in the MP3 with `--autoembed`.\n\nIf the `cover.jpg`, `folder.jpg`, or embedded cover differ, it will present them to you (with an audible alarm if you use `--ping`) so that you can select the correct one. If you choose none of them, it will search online for cover art.  \n\nIf you use `--safe` it will merely output what commands it *would* run.\n\nIf you use `--remove` it will remove existing covers from MP3s before adding the chosen cover.\n\nIf you use `--loud` it will spit a *lot* of stuff out onto the terminal.  Some sub-commands output text to `$STDOUT` whether I want them to or not.\n\nIf you use `--checkall`, it will prompt you to confirm each album cover, even if it all matches.\n\nYou can also force it to search online for each album using `--everything`, which implies `--checkall` in practice, as the checksum of a downloaded cover *probably* is slightly different than what you have. \n\nWhich sounds like a lot, but you can point `f_fix_covers.sh` at  your *entire* music collection, or just at a *specific* album directory. Feed the ones you want to check in one at a time with `xargs` if you feel like it.\n\nTwo important notes: \n\n1. **This script assumes that each directory contains the same album, even if the artists are different.**  You will get *wrong* results if you have a bunch of different MP3s from different albums in the same directory.\n2. If there is a single existing cover -- or single version, rather -- in the directory, the script **assumes it is correct** and will automatically assume that it is the correct cover. If you want to **verify** existing covers, use `--checkall` or `--everything`.\n## Usage\n\n    `f_fix_covers.sh -d [PATH/TO/MUSIC] [OPTIONS]`\n\n### Options:\n    \n* `-h|--help         : This.`\n* `-a|--autoembed    : Embed found, selected covers into MP3s.`\n* `-p|--ping         : Play audible tone when user input needed.`\n* `-r|--remove       : Remove existing embedded images in MP3s when cover found.`\n* `-c|--checkall     : Manually verify all album covers, even if only one.`\n* `-e|--everything   : Check online for covers for every album.`\n* `-s|--safe         : Just say what it would do, do not actually do operations.`\n* `-l|--loud         : Verbose output.`\n* `-d|--dir [DIR]    : Specify the music directory to scan.`\n\n## Dependencies (or the stuff that does the heavy lifting):\n\n * [eye3D](http://eyed3.nicfit.net/)\n * [glyr](https://github.com/sahib/glyr)\n * [eyeD3](http://eyed3.nicfit.net/)\n * [sacad](https://github.com/desbma/sacad)\n * [YAD](https://sourceforge.net/projects/yad-dialog/) \n \n The following can be installed on Debian/Ubuntu based systems by:\n `sudo apt install feh mpg123 imagemagick ffmpeg grep sed wget curl coreutils`.\n \n * `feh` \n * `mpg123` or `mplayer` or `mpv`\n * `imagemagick` \n * `ffprobe` from `ffmpeg`\n * `grep` \n * `sed` \n * `wget` \n * `curl` \n * `timeout` from `coreutils`\n \n \n# yad_show_mpd\n\n# yad_show_mpd.sh\n\nThis script -- which should also have an image file named `defaultcover.jpg` in \nits directory -- requires [mpc](http://git.musicpd.org/cgit/master/mpc.git/), \n[imagemagick](https://imagemagick.org/), and [YAD](https://sourceforge.net/projects/yad-dialog/) to \ncreate a popup with the albumart and trackname of the currently playing song from \n[MPD, the music player daemon](https://www.musicpd.org/) or `audacity` with the use of `audtool`.\n\nIt assumes your music directory is in `${HOME}/Music`, that your album art is \nnamed either `cover.jpg` or `folder.jpg` and that `mpc` is already \nset up correctly. The window will auto-close after 10 seconds.\n\nIt will attempt to use the environment variable `MPD_HOST`, and \nif it is not found, will examine ${HOME}/.bashrc to see if it is set there (if a \nnon-login shell) and set it for the program. If you have a password set for MPD, \nyou *must* use `MPD_HOST=Password@host` for it to work.\n\n\n![output](https://github.com/uriel1998/yolo-mpd/raw/master/yad_show_mpd.png \"What it looks like\")\n\n\n# terminalcovers.sh\n\n\nThe first version is kind of a hack-y way to show terminal covers in the terminal. It's `terminal_covers_old.sh` if you're interested.\n\nThe second version of `terminal_covers.sh` is *much* better.  Using the basic logic (and limited \ncache system) as `yadshow` above, along with help from `qdbus`, it's able to pick up\ncovers from a much wider range of players without any user input.  Currently supports \nClementine, Strawberry, PlexAmp, and MPD out of the box (in that order of priority).  \n\n### Note for MPD\n\nYou should set MPD_HOST or have it exist in `.bashrc`; if neither is set, it will go with the defaults, which *will* fail if you have a password set.  `MPD_HOST=PASSWORD@HOST`  If you have a non-standard port, you'll need to edit the script.  It assumes your music's base directory is `${HOME}/Music`.\n\n`terminal_covers.sh` also uses a range of tools to convert the image into something even a pretty \nnon-advanced terminal can show.  It rounds rectangles of the coverart (useful if you pickup the resulting image \nwith something like `conky`) using `imagemagick` if installed, and will use (in this order) \nthese tools to render the images:  `timg`, `jp2a`, `img2txt.py`, `asciiart`.  `jp2a` and `asciiart` are \nin Debian repositories, but `timg` is worth it.\n\n`terminal_covers.sh`  can also optionally give you a notification via `notify-send` if you run it with `--notify` as the (only) argument.\n\nIt runs in a terminal window on a timed 2-second loop. If the song information is\nunchanged, it does nothing. If it's changed (either because another player started or the track changed), \nthen it figures out what the album art is and goes from there.  \n\nYou can also use the output files in `${HOME}/.cache/yadshow/` with other programs to get the song information and cover as well.\n\n\nDependencies: \n\n* [mpc](http://git.musicpd.org/cgit/master/mpc.git/)\n* [qdbus](https://manpages.ubuntu.com/manpages/focal/man1/qdbus.1.html) -- in the `qtchooser` package on Debian\n\nOne or more of the following:  \n* [timg](https://github.com/hzeller/timg)\n* [jp2a](https://github.com/cslarsen/jp2a)\n* [img2txt](https://pypi.org/project/img2txt/)\n* [asciiart](https://commandmasters.com/commands/asciiart-linux/)\n\n![output](https://github.com/uriel1998/yolo-mpd/raw/master/terminal_covers.gif \"What it looks like\")\n\n(The image above also has `cava`, `scope-tui`, and `ternminal` in it, and is using `timg` for the art.)\n\n\n# mpdcontrol.sh\n\nSelect whether you want to choose a playlist, or by album, artist, or genre. Clears playlist (IF YOU USE THE SWITCH -c), adds what you chose, starts playing. Optionally, if `fzf` is installed on the system, it will seamlessly substitute that program in, with the option to select multiple entries at once (use TAB). \n\nYou can also use the command line argument `nowalbum` or `nowartist` to add the currently playing album or all of the album artist's tracks to the queue (put `-c` first to have it clear the queue first).\n\nThe SSH version is for exactly that, especially if you don't have `pick` on that machine.\nThe `mpdcontrol_add.sh` file does *not* clear the queue so that you can add to the existing playlist.\n\nDependencies: \n* [pick](https://github.com/thoughtbot/pick)\n* [mpc](http://git.musicpd.org/cgit/master/mpc.git/)\n\nOptional Dependency\n* [fzf](https://github.com/junegunn/fzf)\n\n![output](https://github.com/uriel1998/yolo-mpd/raw/master/out.gif \"What it looks like\")\n\n\n# terminal_multiplexer\n\nUses tmux, xterm, ncmpcpp, cava, and [terminal covers](https://github.com/uriel1998/yolo-mpd#terminalcoverssh) to provide a nice layout. Title set to screen by wmctrl.  No tmux.conf file needed.  Inspired by [this reddit post](https://www.reddit.com/r/unixporn/comments/3q4y1m/openbox_music_now_with_tmux_and_album_art/).\n\nDependencies: \n* [mpc](http://git.musicpd.org/cgit/master/mpc.git/)  \n* [tmux](https://tmux.github.io/)  \n* [ncmpcpp](https://github.com/arybczak/ncmpcpp)  \n* [wmctrl](https://linux.die.net/man/1/wmctrl)  \n\nOne or more of the following:  \n\n* [AA-lib](http://aa-project.sourceforge.net/aview/)\n* [libcaca](http://caca.zoy.org/wiki/libcaca)\n* [img2text](https://github.com/hit9/img2txt)\n\n![AA-lib](https://github.com/uriel1998/yolo-mpd/raw/master/aaview_layout.jpg)\n![asciiart](https://github.com/uriel1998/yolo-mpd/raw/master/asciiart_layout.jpg \"asciiart output\")\n![img2txt](https://github.com/uriel1998/yolo-mpd/raw/master/img2txt_layout.jpg \"img2txt output\")\n\n\n# bpmhelper.sh\n\nUses the bpm-tag package, which analyzes BPM quite nicely on linux, but doesn't\npreserve the file date. So this wrapper uses eyeD3 to determine if a BPM is \nalready written, then if not, analyzes the file, then uses eyeD3 to do the \nwriting to the file. I already have eyeD3 for the album art script; a solution \nthat does not rely on that dependency can be found \nat [bpmwrap](https://github.com/meridius/bpmwrap).\n\n`bpm-tag` outputs error messages if you do not have id3v2 already installed and \nthus makes the script fail. Install the debian package `id3v2`.\n\nAccepts two command line arguments (optional)\n\nUse --save-existing to save existing data.  \nUse --skip-existing to skip further analysis of those that have existing BPM\nUse --quiet to suppress output (eyeD3 may still output to the screen)\n\nAnalyzes the current directory *and all subdirectories*.\n\nDependencies\n* [bpm-tools](http://www.pogo.org.uk/~mark/bpm-tools/)\n* [eye3D](http://eyed3.nicfit.net/)\n\n# mp3gainhelper.sh\n\nWell, switched to `loudgain` which uses a (better) way of calculating gain. HOWEVER, unlike `mp3gain`, \nit does not have a way to preserve file date and time.  So the gainhelper is still here. \n\nAccepts only one command line argument (optional) giving the directory to analyze. Otherwise analyzes the current directory *and all subdirectories*.\n\nDependencies: \n* [loudgain](https://github.com/Moonbase59/loudgain)\n\n\n# webserver.covers.sh\n\nVery simple script to make your album covers accessible by MPoD or \nother remote clients without exposing your entire music directory by \ncopying the cover files to the webserver root. (You need to edit this, obvs.)\n\nDependencies:\n* [rsync](https://en.wikipedia.org/wiki/Rsync)\n\n\n# mediakey.sh\n\nThis script uses the MPRIS interface to control your media players.  \nCurrently supported players include MPD, Pithos, Audacious, and Clementine\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furiel1998%2Fyolo-mpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furiel1998%2Fyolo-mpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furiel1998%2Fyolo-mpd/lists"}