about summary refs log tree commit diff
path: root/sh/mpvsel_douyu
blob: a5625f0487f6c3c55c7cb4c8978ad9e55565532b (plain)
1
2
3
4
5
6
7
8
9
10
#!/bin/sh
# references:
# https://www.rockyourcode.com/til-how-to-watch-youtube-videos-with-mpv-and-keyboard-shortcuts/
# https://github.com/mpv-player/mpv/issues/7792

url=$(xsel -ob)
case $url in
	*'douyu'*) alacritty -e mpv "$(basename "$url" | python "$HOME/programs/real-url/douyu.py" | tail -1)" & ;;
	*) mpv --ytdl-format='bestvideo[height<=?900][fps<=?60][vcodec!^=?vp9][vcodec!^=?av01]+bestaudio/bestbestvideo[height<=?900][fps<=?60][vcodec!^=?vp9][vcodec!^=?av01]' --ytdl-raw-options='write-sub=,sub-lang="en,en-US,en-GB,zh-CN,zh-Hans,zh-Hant,zh-HK,zh-SG,zh-TW"' --fs --speed=2 --af=rubberband=pitch-scale=0.981818181818181 "$url" ;;
esac