Skip to content

lxl66566/auto-play-in-mpv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auto play in MPV

Automatically redirect to mpv player when playing online video.

Installation / Usage

  1. install auto-play-in-mpv: pipx install auto-play-in-mpv, start as apim.
  2. install tampermonkey in your browser
  3. install the script from greasyfork
  4. just click a video from supported sites.

mpv config

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

Autostart server

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

  • On general platforms: please use my another script user-startup-py!
  • 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
        kdePackages.kwallet
      ];
    };
    # 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