summaryrefslogtreecommitdiffstats
path: root/bin/youtube_mplayer.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/youtube_mplayer.sh')
-rwxr-xr-xbin/youtube_mplayer.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/youtube_mplayer.sh b/bin/youtube_mplayer.sh
new file mode 100755
index 0000000..6409fa1
--- /dev/null
+++ b/bin/youtube_mplayer.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+# Recover the url.
+URL=`xclip -o`
+
+# Determine if it's a youtube video. Returns a result different from 0 if that's the case.
+SITE=`expr match "$URL" "http://www.youtube*"`
+
+if [ $SITE != 0 ]; then
+
+ # Replace with player of your choice
+ mplayer -cache 8192 `youtube-dl -g "$URL"`
+
+else
+
+ get_flash_videos -y -p "$URL"
+
+fi