Skip to content

Instantly share code, notes, and snippets.

@rigelk
Forked from ubone/mpv-ytdl-desktop.md
Created December 21, 2017 14:09
Show Gist options
  • Save rigelk/4b362e16cb02152c8ed7617c55395a85 to your computer and use it in GitHub Desktop.
Save rigelk/4b362e16cb02152c8ed7617c55395a85 to your computer and use it in GitHub Desktop.

MPV, youtube-dl and web browsers

Play YouTube videos (or audio) with 2 clicks?

3_CTHRSQ.png

Video

cp /usr/share/applications/mpv.desktop ~/.local/share/applications/mpvv.desktop

Exec=mpv --no-cache --ytdl-format="(bestvideo[ext=mp4][height<1080]/bestvideo[height<1080])+(bestaudio[abr>128]/bestaudio)/best[ext=mp4][height<1080]/best[height<1080]/best" --player-operation-mode=pseudo-gui -- "$(sselp)"

Audio only (with thumbnail)

cp /usr/share/applications/mpv.desktop ~/.local/share/applications/mpva.desktop

Exec=mpv --ytdl-format="bestaudio[abr>128]/bestaudio" --loop --no-sub-auto --no-stop-screensaver --no-config --script-opts=osc-visibility=always --player-operation-mode=pseudo-gui --external-files-append="$(youtube-dl --get-thumbnail "$(sselp)")" --autofit-smaller=960x480 -- "$(sselp)"

Download music?

cp /usr/share/applications/mpv.desktop ~/.local/share/applications/mpvd.desktop

Exec=st -g 100x20 -e youtube-dl -xf "bestaudio[abr>128]/bestaudio" -o '~/Music/%(title)s.%(ext)s' "$(sselp)"

Add to your panel(s), Copy Link Location and click

Icon=
  • icons/breeze/actions/22/ im-youtube.svg kdenlive-show-video.svg
  • icons/breeze/places/22/ folder-download.svg folder-music.svg

st

sselp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment