summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2014-10-19 00:46:33 +0200
committerFlorian Pritz <bluewind@xinu.at>2014-10-19 00:46:33 +0200
commit3ca708314f81857b2d4e288123b86d5e5bf2ea95 (patch)
treef7f8a16384a62f7d4e3558cf46aa660799cd9ed4
parente769721453557d60fe6144b5ad2c796cc8c03e86 (diff)
downloadbin-3ca708314f81857b2d4e288123b86d5e5bf2ea95.tar.gz
bin-3ca708314f81857b2d4e288123b86d5e5bf2ea95.tar.xz
firefox-youtube-handler: misc improvements
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfirefox-youtube-handler13
1 files changed, 10 insertions, 3 deletions
diff --git a/firefox-youtube-handler b/firefox-youtube-handler
index c071f95..2649016 100755
--- a/firefox-youtube-handler
+++ b/firefox-youtube-handler
@@ -1,13 +1,20 @@
#!/bin/bash
+
+if ! tty; then
+ exec 1<&-
+fi
+
proto='yt://'
url=$1
id=${url##$proto}
-audiourl="$(youtube-dl -g -f 141/140 -- "$id")"
-videourl="$(youtube-dl -g -f 138/264/137/136/135/134 -- "$id")"
+#audiourl="$(youtube-dl -g -f 141/140 -- "$id")"
+#videourl="$(youtube-dl -g -f 138/264/137/136/135/134 -- "$id")"
+audiourl="$(youtube-dl -g -f bestaudio -- "$id")"
+videourl="$(youtube-dl -g -f bestvideo -- "$id")"
#vlc "$videourl" --input-slave "$audiourl"
-mpv --title "YouTube - $id" --no-cache --demuxer-lavf-o=fflags=+ignidx "$videourl" --audio-file "$audiourl"
+mpv --really-quiet --title "YouTube - $id" --no-cache --demuxer-lavf-o=fflags=+ignidx "$videourl" --audio-file "$audiourl"
#mplayer "$videourl" -audiofile "$audiourl"
# max 720p because youtube serves 1080p only via DASH (seperate audio/video streams)