Skip to content

kerobaros/python_mpd_toys

Repository files navigation

python_mpd_toys:

Basically, this is me playing with python-mpd2.

Contents:

random_album: Randomly picks an album from your library, sets your playlist to said album's contents, and pushes play.

Usage: random_album.py [options]

Options:
  -h, --help                 show this help message and exit
  -a ARTIST, --artist=ARTIST Specifies an artist to limit album choices from; needs
                             to be a quoted string
  -y YEAR, --year=YEAR       Specifies a year to limit album choices
  -d, --debug                Outputs debug text and prevents modifying MPD server

similar_artists: Uses an artist you specify (or the artist of the current song), gets a list of similar artists from last.fm, and builds a playlist out of what it can find in your library. (Requires pyscrobble.)

Usage: similar_artists.py [options]

Options:
  -h, --help                 show this help message and exit
  -a ARTIST, --artist=ARTIST Specifies an artist to start building playlist from;
                             needs to be a quoted string
  -l LIMIT, --limit=LIMIT    Specifies length of playlist; defaults to 50
  -d, --debug                Outputs debug text and prevents modifying MPD server

mpd-albumart: Searches a few locations for the album art for the currently playing song and symlinks it to /tmp/mpd.jpg. Created to use with conky, in a manner similar to the following: ${execi 2 /usr/local/bin/mpd-albumart.py} # execute art script every two seconds ${image /tmp/mpd.jpg -n -s 250x250 -p 12,420} # place /tmp/mpd.jpg, resized to 250x250, at pixel 12,420 relative to top left corner of conky's display

mpdrating.py: Keeps track of per-track ratings for MPD in a file at ~/.mpd/ratings.db, which consists of key:value pairs of the track's location (relative to MPD's music root) and an integer rating, 1-5. When called with an integer 1-5 as the sole argument, script sets rating for currently playing track in ratings.db as the given integer. (If giving a song a rating of 1, script tells MPD to skip to the next song in the playlist as well.) When called with a dash ('-') as sole argument, script returns a series of asterisks ('') according to rating of currently playing track. (ie. rating of 2 returns "**", rating of 4 returns "***") When called with any other argument, or a lack thereof, script returns set rating of current song, or '0' if none exists.

Example ratings.db: The Beatles/Revolver (Stereo Remaster)/14 Tomorrow Never Knows.flac:4 Five Iron Frenzy/The End is Here/1-14 American Kryptonite.flac:4 The Beatles/Rubber Soul (Mono Remaster)/03 You Won't See Me.flac:3 Manfred Mann's Earth Band/The Best Of Manfred Mann's Earth Band/03 Quit Your Low Down Ways.flac:2 Tom Waits/Real Gone/04 Shake It.flac:2

About

Playing around with MPD and python-mpd2.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages