Git Product home page Git Product logo

mpv-handler's Introduction

English | 简体中文 | 繁体中文

mpv handler

A protocol handler for mpv, written by Rust.

Use mpv and yt-dlp to play video and music from the websites.

Please use it with userscript:

play-with-mpv

Protocol

Plugins

  • play: Use mpv player to play video

Encoded URL

Use URL-safe base64 to encode the URL.

Replace / to _, + to - and remove padding =.

Example (JavaScript):

let data = btoa("https://www.youtube.com/watch?v=Ggkn2f5e-IU");
let safe = data.replace(/\//g, "_").replace(/\+/g, "-").replace(/\=/g, "");

Parameters (Optional)

cookies = [ www.domain.com.txt ]
profile = [ default, low-latency, etc... ]
quality = [ best, 2160p, 1440p, 1080p, 720p, 480p, 360p ]
v_codec = [ av01, vp9, h265, h264 ]
subfile = [ Encoded URL ]

Installation

Linux

  • Arch Linux

    mpv-handler
    mpv-handler-git

Manual installation

  1. Download latest Linux release
  2. Unzip the archive
  3. Copy mpv-handler to $HOME/.local/bin
  4. Copy mpv-handler.desktop to $HOME/.local/share/applications/
  5. Set executable permission for binary
$ chmod +x $HOME/.local/bin/mpv-handler
  1. Register xdg-mime (thanks for the linuxuprising reminder)
$ xdg-mime default mpv-handler.desktop x-scheme-handler/mpv
  1. Add $HOME/.local/bin to your environment variable PATH (if needed)
  2. Create $HOME/.config/mpv-handler/config.toml and edit it (if needed)

Windows

Windows users need to install manually.

Manual installation

  1. Download latest Windows release
  2. Unzip the archive to the directory you want
  3. Run handler-install.bat register protocol handler
  4. Add mpv and yt-dlp to environment variable PATH (if needed)
  5. Edit config.toml (if needed)

macOS (Alpha)

I haven't tested it, if it doesn't work, please open an issue.

macOS users need to install manually

Manual installation

  1. Download latest macOS release
  2. Unzip the archive and copy mpv-handler.app directory to $HOME/Applications
  3. Add mpv and yt-dlp to environment variable PATH (if needed)
  4. Create $HOME/Library/Application Support/mpv-handler/config.toml and edit it (if needed)

Configuration

If you have already added mpv and yt-dlp to PATH, manual configuration is usually not required.

mpv = "/usr/bin/mpv"

# Optional, Type: String
# The path of mpv binary
# Default value:
# - Linux: mpv
# - Windows: mpv.com

ytdl = "/usr/bin/yt-dlp"

# Optional, Type: String
# The path of youtube-dl binary
# Default value:
# - Linux: yt-dlp
# - Windows: yt-dlp.exe

# For Windows users:
#   The path can be "C:\\folder\\some.exe" or "C:/folder/some.exe"

mpv-handler's People

Contributors

akiirui avatar bpking1 avatar skbeh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.