Playlists for the terminally lazy
Go to file
2020-02-20 00:17:22 -06:00
.gitignore Create gitignore 2019-09-26 03:05:04 -05:00
LICENSE Add LICENSE 2019-09-26 19:00:13 +00:00
ptgdp Rework argument parsing to support position-independent arguments 2020-02-20 00:17:22 -06:00
ptgdp-rofi Improve rofi args in ptgdp-rofi 2019-10-18 23:37:22 -05:00
ptgdp.conf Add Audacious support 2019-09-26 16:58:37 -05:00
README.md Make README slightly more clear 2019-09-26 19:19:50 -05:00

ptgdp: Play the Goddamned Playlist

A tool to play a plaintext music playlist composed entirely of youtube-dl search queries or URLs

Installation

Put ptgdp somewhere in $PATH and install youtube-dl. Additionally, you need some implementation of pgrep, which is probably already on your system, and Bash.

Quickstart

Make a file containing some download queries. For example:

myplaylist
nine inch nails play the goddamned part
alice in chains love hate love
megadeth high speed dirt
tool parabola

Then invoke ptgdp:

ptgdp myplaylist

And that's basically it. See ptgdp -h and the sections below for more info.

Configuration

Move ptgdp.conf from this repo to ~/.config/ptgdp.conf and change the values as you see fit. Alternatively, invoke ptgdp with -c and point it at your config file.

Return Codes

Code Meaning
1 Syntax error
50 Misconfigured backend
51 Backend could not be set up (i.e. mpd failed to update)
60 Playlist does not exist
61 Playlist is unreadable

Tips

  • ytsearch: is only the default search. If a line is prefixed with another search type (ex. scsearch:dagoth ur fanfiction), youtube-dl will respect it.

  • You can use URLs if you want to.

  • You can comment a playlist file by prefixing the line with #.

FAQ

Q: Why?

A: I wanted to kick my dependence on Spotify while still having access to easy music. At first I just used YouTube, but after fighting their horrid suggestions system, I decided it probably wouldn't be too hard to use youtube-dl to wrap it. Thus this tool was born.

Simple plaintext playlist files and a rofi script to queue them up with only a couple keystrokes seemed like a convenient enough implementation to me.

Q: Holy fuck ow my disk space

A: Songs are stored in ~/Music/PTGDP Songs. Clean it up if it gets too big; they'll be redownloaded as needed. Songs are cached both for offline usage and because YouTube searches aren't exactly the most consistent things over time.

On the bright side, though, youtube-dl downloads most songs in Opus, which has insane quality per byte.

Q: Why is your tool downloading the shitty "w/ lyrics" versions of songs with ass quality?

A: Because YouTube searches suck. That being said, they will also parse out descriptions, so you can stick the copyright text or something in your search query. Alternatively, find a good video and just stick the URL in your playlist.

Q: Why isn't my music player supported?

A: Open a bug report/pull request. Alternatively, use ptgdp -m and some glue.

Bugs

  • Because I haven't quite figured out how to into mpd sockets, this tool assumes that $XDG_MUSIC_DIR (~/Music) is the root of your library when using the mpd backend.