> Nathan's notes_ Search Rice Projects Reading Root

Youtube rip with dwb + youtube-dl

24 May 2014

Just finished a snippet that can be used in combination with dwb(or many other browsers, probably) to auto download a youtube video and convert it to audio using youtube-dl.

1
2
3
4
#!/bin/bash
#dwb: xf
download_dir=/my/media/dir
youtube-dl -x -o $download_dir'/%(uploader)s/%(title)s.%(ext)s' $DWB_URI

It can probably be noted that I had some trouble with the youtube-dl naming syntax at first - the ā€˜%(title)sā€™ and such needs to be in a string or else bash freaks out. Also this will fail without ffmpeg, as that is a dep for audio conversion with youtube-dl.