Hacker News new | past | comments | ask | show | jobs | submit login

I have a similar function in my bashrc, which also relies on youtube-dl (which is amazing, btw, it does a LOT more than YouTube – bandcamp, SoundCloud, etc).

`play` will instantly play any song (great for parties), and `mp3` will download it: https://github.com/exogen/dotfiles/blob/730fb8e2b72b2fc3aa3d...




I think the best part of youtube-dl is its support for bulk downloads. Point it at a YouTube account or playlist, a podcast on SoundCloud, or even, if you can live with yourself, an album on Bandcamp, and it will snarf up every piece of media it can find.


Some pro trips: by default it searches YouTube for the argument you give it, but if given a URL, youtube-dl will always use that instead. So `play <bandcamp URL>`, `mp3 <SoundCloud URL>` will work.

If the first result for your search isn't the song you want, I usually append "hq", "hd", or "album version".


Nice! Works fine on windows with gitbash except for the --exec part, I tried to use the "start" command but it doesn't like the single quote around the path, someone has an idea to workaround that?


1. "function" is non-standard useless syntax 2. mpv now knows how to automatically spawn youtube-dl, fetch the URL, and stream it given a YouTube argument.


per (1), these are my dotfiles and I use Bash exclusively, ergo, I use the syntax I consider better (because you can easily search for "function" and not the standard syntax with no keyword).


I don't want to give it a YouTube URL though – with this I can type `play pixies debaser`.


I get:

   youtube-dl: error: no such option: --youtube-skip-dash-manifest
As an error, am I missing something?


An outdated version of youtube-dl, is all I can think of – run `youtube-dl -U`.


A command that you can run almost every day and still get new updates because of the ridiculously fast release cycle.


Absolute champion


Nice! Added to my dotfiles :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: