123456789101112131415161718192021222324252627282930313233343536 |
- #!/bin/sh
- url=$($url|dmenu -i -p "Paste Url:")
- [ "$url" = "" ] && exit
- mediamenu() {
- options=" mpv (video)\n mpv (audio)\n yt-dlp (video)\n yt-dlp (audio)\n yt-dlp (channel)\n wget\n nsxiv\n zathura\n librewolf\n tor\n torrent"
- selected=$(echo "$options" | dmenu -i -p "Open with?" )
- if [ "$selected" = " mpv (video)" ]; then
- $VIDEO "$url"
- elif [ "$selected" = " mpv (audio)" ]; then
- $TERMINAL -c mpv_terminal -e mpv --no-video "$url"
- elif [ "$selected" = " yt-dlp (video)" ]; then
- $TERMINAL yt-dlp --restrict-filenames -i -f "bv*[ext=webm]+ba[ext=vorbis]/b[ext=webm] / bv*+ba/b" -o "%(title)s.%(ext)s" -P "$HOME/downloads/" "$url"
- elif [ "$selected" = " yt-dlp (audio)" ]; then
- $TERMINAL yt-dlp --restrict-filenames -i -f "ba" -x --audio-format "vorbis" -o "%(title)s.%(ext)s" -P "$HOME/downloads/" "$url"
- elif [ "$selected" = " yt-dlp (channel)" ]; then
- $TERMINAL yt-dlp --restrict-filenames -f "bv*[ext=webm]+ba[ext=vorbis]/b[ext=webm] / bv*+ba/b" -o "%(channel)s/%(title)s.%(ext)s" -P "$HOME/downloads/" "$url"
- elif [ "$selected" = " wget" ]; then
- $TERMINAL wget --mirror --convert-links --page-requisites --adjust-extension -P "$HOME/downloads/" "$url"
- elif [ "$selected" = " nsxiv" ]; then
- $IMAGE_URL "$url"
- elif [ "$selected" = " zathura" ]; then
- curl -sL "$url" > "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" && $PDF "/tmp/$(echo "$url" | sed "s/.*\///;s/%20/ /g")" >/dev/null 2>&1
- elif [ "$selected" = " librewolf" ]; then
- $BROWSER "$url"
- elif [ "$selected" = " tor" ]; then
- $HOME/.config/tor-browser/Browser/start-tor-browser --allow-remote "$url"
- elif [ "$selected" = " torrent" ]; then
- $TORRENT "$url"
- return
- fi
- }
- mediamenu
|