Steven Saus
a7af7ae1d5
|
1 week ago | |
---|---|---|
docs | 6 months ago | |
.gitignore | 4 years ago | |
444918__matrixxx__ping.mp3 | 6 months ago | |
LICENSE | 10 years ago | |
README.md | 2 months ago | |
aaview_layout.jpg | 7 years ago | |
aaview_output.png | 9 years ago | |
asciiart_layout.jpg | 7 years ago | |
bpmtoolshelper.sh | 2 months ago | |
defaultcover.jpg | 6 months ago | |
edit_tags_nowplaying.sh | 6 months ago | |
f_fix_covers.sh | 1 week ago | |
img2txt_layout.jpg | 7 years ago | |
libcaca_output.png | 9 years ago | |
mediakey.sh | 2 years ago | |
mp3gainhelper.sh | 2 months ago | |
mpdcontrol.sh | 2 months ago | |
mpdcontrol_add.sh | 4 years ago | |
mpdcontrol_ssh.sh | 8 years ago | |
out.gif | 9 years ago | |
show_covers_w3mimage.sh | 6 years ago | |
stream_to_mpd.sh | 2 years ago | |
terminal_covers.sh | 7 years ago | |
terminal_multiplexer.sh | 6 years ago | |
webserver_covers.sh | 8 years ago | |
yad_show_mpd.png | 6 months ago | |
yad_show_mpd.sh | 4 weeks ago | |
yolo-mpd-icon.png | 4 years ago |
README.md
yolo-mpd
Various MP3 and MPD tweaks, tips, tools, and scripts I've put together or found and tweaked.
Contents
stream_to_mpd
Dependencies:
- streamlink
grep
,awk
,curl
,wget
, andzenity
, all likely included in your distro packaging.
Feed 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
Usage: stream_to_mpd [OPTIONS] [STREAM_URL]
--host PASSWORD@HOST
: Needed if your MPD server is not on localhost or you have a password set
--mpd
: skip right to MPD output
--playlist
: skip right to adding stream URL to a file/playlist
--native
: Throw the result to streamlink (probably not needed, but hey)
--bookmarks
: use zenity
to choose a hardcoded bookmark instead of a stream URL
f_fix_covers
This 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
.)
If 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
.
If 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.
If you use --safe
it will merely output what commands it would run.
If you use --remove
it will remove existing covers from MP3s before adding the chosen cover.
If 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.
If you use --checkall
, it will prompt you to confirm each album cover, even if it all matches.
You 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.
Which 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.
Two important notes:
- 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.
- 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
.
Usage
`f_fix_covers.sh -d [PATH/TO/MUSIC] [OPTIONS]`
Options:
-h|--help : This.
-a|--autoembed : Embed found, selected covers into MP3s.
-p|--ping : Play audible tone when user input needed.
-r|--remove : Remove existing embedded images in MP3s when cover found.
-c|--checkall : Manually verify all album covers, even if only one.
-e|--everything : Check online for covers for every album.
-s|--safe : Just say what it would do, do not actually do operations.
-l|--loud : Verbose output.
-d|--dir [DIR] : Specify the music directory to scan.
Dependencies (or the stuff that does the heavy lifting):
The following can be installed on Debian/Ubuntu based systems by:
sudo apt install feh mpg123 imagemagick ffmpeg grep sed wget curl coreutils
.
feh
mpg123
ormplayer
ormpv
imagemagick
ffprobe
fromffmpeg
grep
sed
wget
curl
timeout
fromcoreutils
yad_show_mpd
yad_show_mpd.sh
This script -- which should also have an image file named defaultcover.jpg
in
its directory -- requires mpc,
imagemagick, and YAD to
create a popup with the albumart and trackname of the currently playing song from
MPD, the music player daemon or audacity
with the use of audtool
.
It assumes your music directory is in ${HOME}/Music
, that your album art is
named either cover.jpg
or folder.jpg
and that mpc
is already
set up correctly. The window will auto-close after 10 seconds.
It will attempt to use the environment variable MPD_HOST
, and
if it is not found, will examine ${HOME}/.bashrc to see if it is set there (if a
non-login shell) and set it for the program. If you have a password set for MPD,
you must use MPD_HOST=Password@host
for it to work.
mpdcontrol.sh
Select 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. The SSH version is for exactly that, especially if you don't have pick
on that machine.
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).
The mpdcontrol_add.sh
file does not clear the queue so that you can add to the existing playlist.
Dependencies:
Optional Dependency
terminal_multiplexer
Uses tmux, xterm, ncmpcpp, cava, and terminal covers to provide a nice layout. Title set to screen by wmctrl. No tmux.conf file needed. Inspired by this reddit post.
Dependencies:
One or more of the following:
bpmhelper.sh
Uses the bpm-tools package, which analyzes BPM quite nicely on linux, but then writes tags that overwrite album and genre tags. So this wrapper uses eyeD3 to determine if a BPM is already written, then analyzes the file, then uses eyeD3 to do the writing to the file. I already have eyeD3 for the album art script; a solution that does not rely on that dependency can be found at bpmwrap.
bpm-tools
outputs error messages if you do not have id3v2 and sox with mp3
headers already installed and thus makes the script fail. You can either tweak
the script or install the packages sox
, libsox-fmt-mp3
, and id3v2
.
Accepts two command line arguments (optional)
Use --save-existing to save existing data.
Use --skip-existing to skip further analysis of those that have existing BPM
Use --quiet to suppress output (eyeD3 may still output to the screen)
Analyzes the current directory and all subdirectories.
Dependencies
mp3gainhelper.sh
Well, switched to loudgain
which uses a (better) way of calculating gain. HOWEVER, unlike mp3gain
,
it does not have a way to preserve file date and time. So the gainhelper is still here.
Accepts only one command line argument (optional) giving the directory to analyze. Otherwise analyzes the current directory and all subdirectories.
Dependencies:
webserver.covers.sh
Very simple script to make your album covers accessible by MPoD or other remote clients without exposing your entire music directory by copying the cover files to the webserver root. (You need to edit this, obvs.)
Dependencies:
terminalcovers.sh
A kind of hack-y way to show terminal covers in the terminal. Uses either AA-lib or libcaca. AA-lib looks MUCH better, but doesn't automatically exit, so requires killall (yeah, that sucks). You will need to edit the script to choose a different renderer.
Dependencies:
One or more of the following:
AA-lib output
libcaca output
mediakey.sh
This script uses the MPRIS interface to control your media players.
Currently supported players include MPD, Pithos, Audacious, and Clementine