youtube-dl integration

This script allows you to pull down the highest quality version of a YouTube video as an MP4 file, letting you avoid having to use Flash Player.

To use this script as is, you will need an youtube-dl and ratpoison (for completion notifications), though changes can be made to fit your personal setup. Feel free to add any mods to this page!

Script

#!/bin/dash
cd ~/Downloads                                   # change this line to determine where the file is saved
python2 youtube-dl -o %\(title\)s.%\(ext\)s "$1" # -o output template is optional
# play with mplayer after download
savename=`python2 youtube-dl -o %\(title\)s.%\(ext\)s --get-filename "$1"`
mplayer -really-quiet "$savename"
ratpoison -c "echo [ytdl-uzbl] $1 done."         # change this line to change how you are notified of a
                                                 # completed download

Binding

Add the following line to your uzbl config file:

@cbind    ytdl      = sh '~/bin/ytdl-uzbl.sh "$UZBL_URI"'
 
youtube-dl.txt · Last modified: 2011/05/26 08:24 by geocanton
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki