Skip to main content

Automatically redirect to mpv player when playing online video

Project description

Auto play in MPV

Automatically redirect to mpv player when playing online video.

Installation / Usage

  1. install auto-play-in-mpv: pip install auto-play-in-mpv or uv tool install auto-play-in-mpv, start the server by executing apim in your terminal.
  2. install tampermonkey/violentmonkey in your browser
  3. install the script from greasyfork
  4. just click a video from supported sites. (this script mainly works on bilibili. youtube support is not tested yet)

mpv config

Note that this is just my config example. You may need to change some settings.

If you find mpv is not playing the video, you may need to run mpv https://bilibili.com/video/xxx to test if your mpv profile is working.

Autostart server

It's better to start the websocket server automatically at startup.

  • On general platforms: please use my another script user-startup-rs!
  • On NixOS: Add this to your configuration.nix
    systemd.user.services.apim = {
      enable = true;
      description = "Open online video in local mpv player";
      script = "~/.local/bin/apim";
      wantedBy = [ "default.target" ];
      path = with pkgs; [
        mpv
        yt-dlp
      ];
    };
    # do not forget to add your current user to some groups
    users.users.<your_user_name> = {
      isNormalUser = true;
      extraGroups = [
        "wheel"
        "networkmanager"
        "video"
        "render"
        "audio"
      ];
    };
    

Supported sites

  • bilibili (video, live)
  • youtube

TODO

  • auto start
  • fix behavior on youtube

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

auto_play_in_mpv-0.1.3.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

auto_play_in_mpv-0.1.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file auto_play_in_mpv-0.1.3.tar.gz.

File metadata

  • Download URL: auto_play_in_mpv-0.1.3.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for auto_play_in_mpv-0.1.3.tar.gz
Algorithm Hash digest
SHA256 50a04f409057fb3ec5553f442d257d3f6333e1988f3089895d1b7854e200f45d
MD5 b3425efbf8bd5dd88278152de213d480
BLAKE2b-256 f4220b73d925d69ace238b7fade00e6970552197abfeb8d046627e11977e16d8

See more details on using hashes here.

File details

Details for the file auto_play_in_mpv-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for auto_play_in_mpv-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 90bb163c37a73e73f7fb7ce7e5b33b490df174a82d054e382f340c1c8bcb5d30
MD5 3c29157501c2712cda48dd6cbba0c2c3
BLAKE2b-256 827e6d4632676178a237c6b6a62b850fc85ae8970196b0691eeac7d1c20481c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page