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.4.tar.gz (21.3 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.4-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for auto_play_in_mpv-0.1.4.tar.gz
Algorithm Hash digest
SHA256 823653c2ebb17454bc2eec4b57dfd2934634f3abacc79fdf508619dc0b481e58
MD5 82402dacc4768181027692d5682c6124
BLAKE2b-256 61863e38f3831f53f6b0c4c19e631bc152a85eb51b88b6a841ec8a2070a5f2cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for auto_play_in_mpv-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4c669aedccbc76a8e10d14757d2cef233f1cb9c1f512b9afd1eb187d1f518848
MD5 99e90a10639b2015ce2dc28a5d5a316f
BLAKE2b-256 3395988fd464490f29e7605c4fe27f78da5e617bedf795be16f6bb0293ee8dfc

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