../𝚂𝚃𝚇
source

youtube rip with dwb + youtube-dl

Published 2014-05-24, last edit 2019-02-19

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.

#!/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.