[wiki] [sites] added script to watch flash-videos with local player || Doomicide

From: <git_AT_suckless.org>
Date: Fri, 28 Jun 2013 16:12:59 +0200

commit 75b7d2b5cceed0a677786e75a3473f507f5df837
Author: Doomicide <dxm_AT_lavabit.com>
Date: Fri Jun 28 16:12:07 2013 +0200

    added script to watch flash-videos with local player

diff --git a/surf.suckless.org/files/not_flash.md b/surf.suckless.org/files/not_flash.md
new file mode 100644
index 0000000..932d839
--- /dev/null
+++ b/surf.suckless.org/files/not_flash.md
_AT_@ -0,0 +1,48 @@
+Watch flash videos with mpv
+===========================
+
+Description
+-----------
+
+Save this script as ~/bin/yt and adjust it to your needs. (Requires [youtube-dl](http://rg3.github.io/youtube-dl/))
+
+
+ #!/bin/sh
+ format="-f34" # leave empty for default
+ player="mpv --quiet --geometry=50%:50% --idx --keep-open"
+ tmpdir="$HOME/tmp"
+
+ url="$1"
+ filepath="$tmpdir/$(youtube-dl --id --get-filename -f34 $url)"
+
+ youtube-dl -c -o $filepath $format $url &
+ echo $! > $filepath.$$.pid
+
+ while [ ! -r $filepath ] && [ ! -r $filepath.part ]; do
+ echo "Waiting for youtube-dl..."
+ sleep 3
+ done
+
+ $player $filepath.part || $player $filepath
+ kill $(cat $filepath.$$.pid)
+ rm $filepath.$$.pid
+
+
+Add this to surf's config.h:
+
+
+ #define WATCH {.v = (char *[]){ "/bin/sh", "-c", \
+ "st -e \
+ yt $(xprop -id $0 _SURF_URI | cut -d \\" -f 2)", \
+ winid, NULL } }
+
+
+and in the keys section:
+
+
+ { MODKEY, GDK_w, spawn, WATCH },
+
+
+Author
+------
+- Maximilian Dietrich - <dxm_at_lavabit_dot_com>
Received on Fri Jun 28 2013 - 16:12:59 CEST

This archive was generated by hypermail 2.3.0 : Fri Jun 28 2013 - 16:24:16 CEST