ptgdp/README.md

75 lines
2.8 KiB
Markdown
Raw Normal View History

2019-09-26 13:59:42 -05:00
# ptgdp: Play the Goddamned Playlist
2019-09-26 19:19:50 -05:00
A tool to play a plaintext music playlist composed entirely of youtube-dl search queries or URLs
2019-09-26 13:59:42 -05:00
2019-09-26 14:40:37 -05:00
## 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.
2019-09-26 14:40:37 -05:00
## Quickstart
2019-09-26 13:59:42 -05:00
2019-09-26 17:53:51 -05:00
Make a file containing some download queries. For example:
2019-09-26 13:59:42 -05:00
myplaylist
2019-09-26 13:59:42 -05:00
```
2019-09-26 17:53:51 -05:00
nine inch nails play the goddamned part
2019-09-26 13:59:42 -05:00
alice in chains love hate love
megadeth high speed dirt
tool parabola
```
Then invoke `ptgdp`:
ptgdp myplaylist
2019-09-26 13:59:42 -05:00
2019-09-26 17:56:42 -05:00
And that's basically it. See `ptgdp -h` and the sections below for more info.
2019-09-26 13:59:42 -05:00
2019-09-26 14:40:37 -05:00
## Configuration
2019-09-26 14:41:11 -05:00
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.
2019-09-26 14:40:37 -05:00
## 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 |
2019-09-26 17:56:42 -05:00
## Tips
2019-09-26 17:53:51 -05:00
* `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.
2019-09-26 17:53:51 -05:00
* You can use URLs if you want to.
2019-09-26 13:59:42 -05:00
2019-09-26 17:53:51 -05:00
* 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.
2019-09-26 17:53:51 -05:00
## 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.