Metadata-Version: 2.3
Name: auto-play-in-mpv
Version: 0.1.2
Summary: Automatically redirect to mpv player when playing online video
Project-URL: Homepage, https://github.com/lxl66566/auto-play-in-mpv
Project-URL: Repository, https://github.com/lxl66566/auto-play-in-mpv.git
License-File: LICENSE
Keywords: mpv,video
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.8
Requires-Dist: validators
Requires-Dist: websockets>=13.0
Description-Content-Type: text/markdown

# 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](https://greasyfork.org/zh-CN/scripts/505562-auto-play-in-mpv)
4. just click a video from supported sites.

## mpv config

Note that this is just [my config example](https://github.com/lxl66566/nixos-config/tree/main/config/mpv/profile.conf). You may need to change some settings.

## Autostart server

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

- On NixOS: Add this to your `configuration.nix`
  ```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
    ];
  };
  ```

## Supported sites

- [x] bilibili (video, live)
- [x] youtube

## TODO

- [ ] auto start
- [ ] fix behavior on youtube

## License

MIT
