Download video relative to your screen size

This commit is contained in:
Ricky Jon 2018-12-15 10:15:48 +11:00
parent d81df93aa0
commit 0e83bf8b6e
4 changed files with 8 additions and 5 deletions

View File

@ -45,9 +45,10 @@ alias diff="diff --color=auto"
alias ccat="highlight --out-format=ansi" # Color cat - print file with syntax highlighting.
# Internet
alias yt="youtube-dl --add-metadata -ic" # Download video link
alias yt="youtube-dl --add-metadata -ic -f '(best[height<=`xrandr | sed -n '/connected primary/p' | awk '{print $4}' | sed 's/x/\n/g' | sed -n 1p`])/best'" #Download video link
alias yta="yt -x -f bestaudio/best" # Download only audio
alias YT="youtube-viewer"
shdl() { curl -O $(curl -s http://sci-hub.tw/"$@" | grep location.href | grep -o http.*pdf) ;}
vf() { $EDITOR $(fzf) ;}
cur_pri_size_h() { xrandr | sed -n '/connected primary/p' | awk '{print $4}' | sed 's/x/\n/g' | sed -n 1p }

View File

@ -32,7 +32,8 @@ color article cyan default
browser linkhandler
macro , open-in-browser
macro t set browser "tsp youtube-dl --add-metadata -ic"; open-in-browser ; set browser linkhandler
macro t set browser "tsp youtube-dl --add-metadata -ic -f '(best[height<=`xrandr | sed -n '/connected primary/p' | awk '{print $4}' | sed 's/x/\n/g' | sed -n 1p`])/best'"; open-in-browser ; set browser linkhandler
macro a set browser "tsp youtube-dl --add-metadata -xic -f bestaudio/best"; open-in-browser ; set browser linkhandler
macro v set browser "setsid nohup mpv"; open-in-browser ; set browser linkhandler
macro w set browser "w3m"; open-in-browser ; set browser linkhandler

View File

@ -513,5 +513,6 @@ map Tt eval fm.open_console('shell eyeD3 -t "" ' + fm.thisfile.relative_path, po
map Tn eval fm.open_console('shell eyeD3 -n "" ' + fm.thisfile.relative_path, position=16)
#Downloading
map ytv console shell youtube-dl -ic%space
map yta console shell youtube-dl -xic%space
map ytv console shell youtube-dl --add-metadata -ic -f '(best[height<=`xrandr | sed -n '/connected primary/p' | awk '{print $4}' | sed 's/x/\n/g' | sed -n 1p`])/best' %space
map yta console shell youtube-dl -xic -f bestaudio/best%space

View File

@ -7,7 +7,7 @@ case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-
mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;;
"mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;;
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp "youtube-dl --add-metadata -ic -f '(best[height<=`xrandr | sed -n '/connected primary/p' | awk '{print $4}' | sed 's/x/\n/g' | sed -n 1p`])/best'" "$1" >/dev/null 2>&1 ;;
browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;;
feh) setsid feh "$1" >/dev/null 2>&1 & ;;
w3m) w3m "$1" >/dev/null 2>&1 ;;