dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit cefdaca3f1e401de3b17726cf63d3a740ae7a35c
parent c240ec86c5d76617a335fc2f454e5560e8efeb85
Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date:   Wed, 14 May 2014 21:13:45 +0200

changed to bash youtube download script

Diffstat:
A.config/dwb/userscripts/youtube-mplayer | 7+++++++
D.config/dwb/userscripts/youtube-mplayer.js | 9---------
2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/.config/dwb/userscripts/youtube-mplayer b/.config/dwb/userscripts/youtube-mplayer @@ -0,0 +1,7 @@ +#!/bin/bash +# dwb: Control y +tmpdir=~/tmp +tmpfile=youtube.mp4 +mkdir -p $tmpdir +youtube-dl --output $tmpdir/$tmpfile $DWB_URI >> $tmpdir/youtube-dl.log 2>&1 +mplayer $tmpdir/$tmpfile diff --git a/.config/dwb/userscripts/youtube-mplayer.js b/.config/dwb/userscripts/youtube-mplayer.js @@ -1,9 +0,0 @@ -//!javascript -// opens YouTube videos with mplayer. -var regex = new RegExp("http(.*)://www.youtube.com/watch\\?(.*&)*v=.*"); - -Signal.connect("navigation", function (wv, frame, request) { - if (wv.mainFrame == frame && regex.test(request.uri)) - system.spawn("sh -c 'mplayer \"$(youtube-dl -g " + request.uri + ")\"'"); - return false; -});