Metadata-Version: 2.4
Name: open-in-mpv
Version: 0.2.0
Summary: Host-side of the extension to open any link or page URL in mpv via the browser context menu.
Project-URL: Issues, https://github.com/Tatsh/open-in-mpv/issues
Project-URL: documentation, https://open-in-mpv.readthedocs.org
Project-URL: homepage, https://tatsh.github.io/open-in-mpv/
Project-URL: repository, https://github.com/Tatsh/open-in-mpv
Author-email: Andrew Udvare <audvare@gmail.com>
License-Expression: MIT
License-File: LICENSE.txt
Keywords: audio,browser extension,mpv,multimedia,video
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: <4.0,>=3.10
Requires-Dist: bascom>=0.1.2
Requires-Dist: click>=8.3.2
Requires-Dist: platformdirs>=4.9.6
Requires-Dist: typing-extensions>=4.15.0
Description-Content-Type: text/markdown

# open-in-mpv

<!-- WISWA-GENERATED-README:START -->

[![Python versions](https://img.shields.io/pypi/pyversions/open-in-mpv.svg?color=blue&logo=python&logoColor=white)](https://www.python.org/)
[![PyPI - Version](https://img.shields.io/pypi/v/open-in-mpv)](https://pypi.org/project/open-in-mpv/)
[![GitHub tag (with filter)](https://img.shields.io/github/v/tag/Tatsh/open-in-mpv)](https://github.com/Tatsh/open-in-mpv/tags)
[![License](https://img.shields.io/github/license/Tatsh/open-in-mpv)](https://github.com/Tatsh/open-in-mpv/blob/master/LICENSE.txt)
[![GitHub commits since latest release (by SemVer including pre-releases)](https://img.shields.io/github/commits-since/Tatsh/open-in-mpv/v0.2.0/master)](https://github.com/Tatsh/open-in-mpv/compare/v0.2.0...master)
[![CodeQL](https://github.com/Tatsh/open-in-mpv/actions/workflows/codeql.yml/badge.svg)](https://github.com/Tatsh/open-in-mpv/actions/workflows/codeql.yml)
[![QA](https://github.com/Tatsh/open-in-mpv/actions/workflows/qa.yml/badge.svg)](https://github.com/Tatsh/open-in-mpv/actions/workflows/qa.yml)
[![Tests](https://github.com/Tatsh/open-in-mpv/actions/workflows/tests.yml/badge.svg)](https://github.com/Tatsh/open-in-mpv/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/Tatsh/open-in-mpv/badge.svg?branch=master)](https://coveralls.io/github/Tatsh/open-in-mpv?branch=master)
[![Dependabot](https://img.shields.io/badge/Dependabot-enabled-blue?logo=dependabot)](https://github.com/dependabot)
[![Documentation Status](https://readthedocs.org/projects/open-in-mpv/badge/?version=latest)](https://open-in-mpv.readthedocs.org/?badge=latest)
[![mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![uv](https://img.shields.io/badge/uv-261230?logo=astral)](https://docs.astral.sh/uv/)
[![pytest](https://img.shields.io/badge/pytest-zz?logo=Pytest&labelColor=black&color=black)](https://docs.pytest.org/en/stable/)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![Downloads](https://static.pepy.tech/badge/open-in-mpv/month)](https://pepy.tech/project/open-in-mpv)
[![Stargazers](https://img.shields.io/github/stars/Tatsh/open-in-mpv?logo=github&style=flat)](https://github.com/Tatsh/open-in-mpv/stargazers)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
[![Prettier](https://img.shields.io/badge/Prettier-black?logo=prettier)](https://prettier.io/)

[![@Tatsh](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fpublic.api.bsky.app%2Fxrpc%2Fapp.bsky.actor.getProfile%2F%3Factor=did%3Aplc%3Auq42idtvuccnmtl57nsucz72&query=%24.followersCount&label=Follow+%40Tatsh&logo=bluesky&style=social)](https://bsky.app/profile/Tatsh.bsky.social)
[![Buy Me A Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Tatsh-black?logo=buymeacoffee)](https://buymeacoffee.com/Tatsh)
[![Libera.Chat](https://img.shields.io/badge/Libera.Chat-Tatsh-black?logo=liberadotchat)](irc://irc.libera.chat/Tatsh)
[![Mastodon Follow](https://img.shields.io/mastodon/follow/109370961877277568?domain=hostux.social&style=social)](https://hostux.social/@Tatsh)
[![Patreon](https://img.shields.io/badge/Patreon-Tatsh2-F96854?logo=patreon)](https://www.patreon.com/Tatsh2)

<!-- WISWA-GENERATED-README:STOP -->

This browser extension displays a context menu item _Open in mpv_ for links. When clicked it will
pass the URL of the link to mpv (which must be `PATH`).

If you have yt-dlp installed and in `PATH`, then mpv will try to use it to resolve URLs it cannot
handle. This means you can right-click on any YouTube video page or link, choose `Open in mpv` and
view the video with mpv.

## Installation

First, [install the extension](https://github.com/Tatsh/open-in-mpv/releases). Quit your browser.

There are many ways to perform the next step. Below is the most basic, assuming you have Pip
installed.

Gentoo users can simply install `media-video/open-in-mpv` from
[my overlay](https://github.com/Tatsh/tatsh-overlay).

```shell
pip install --user open-in-mpv
open-in-mpv-install --user --force
```

The above commands will install the native host JSON file to supported Chromium-based browsers
whose paths are known for your OS. `--force` is used on first install to create the necessary paths
if they do not exist.

See `open-in-mpv-install --help` for more options. Linux users can pass the `--system` option to
install the native host part of the extension system-wide.

## Uninstallation

Uninstall the extension from your browser. Then follow the steps below depending on how you
installed the native messaging host component:

### General uninstallation

```shell
open-in-mpv-uninstall
pip uninstall open-in-mpv
```

### macOS pkg uninstallation

If you installed open-in-mpv using the macOS pkg installer, follow these steps to completely
uninstall it:

1. Run the uninstall command:

   ```shell
   sudo /usr/local/bin/open-in-mpv-uninstall
   ```

1. Remove the package files:

   ```shell
   pkgutil --only-files --files sh.tat.open-in-mpv | tr '\n' '\0' | xargs -n 1 -0 sudo rm -f
   pkgutil --only-dirs --files sh.tat.open-in-mpv | tail -r | tr '\n' '\0' | xargs -n 1 -0 sudo rmdir
   ```

1. Forget the package:

   ```shell
   sudo pkgutil --forget sh.tat.open-in-mpv
   ```

### Windows

Uninstall open-in-mpv using _Programs & Features_.

## Known issues

**Linux**: mpv is launched with `--gpu-api=opengl` because with Vulkan it starts but fails to open a
window.

At this time, Windows is not supported by the `open-in-mpv` Python script. It may work, but it is
not supported.
