{"id":13514500,"url":"https://github.com/tnychn/mpv-discord","last_synced_at":"2025-03-31T03:30:56.996Z","repository":{"id":37399371,"uuid":"314983341","full_name":"tnychn/mpv-discord","owner":"tnychn","description":"🎈 A cross-platform Discord Rich Presence integration for mpv with no external dependencies.","archived":true,"fork":false,"pushed_at":"2024-10-12T21:07:52.000Z","size":5749,"stargazers_count":174,"open_issues_count":17,"forks_count":14,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-11-01T18:37:11.306Z","etag":null,"topics":["discord","discord-rich-presence","golang","lua","mpv","rich-presence"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tnychn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-22T07:31:41.000Z","updated_at":"2024-10-17T17:14:49.000Z","dependencies_parsed_at":"2024-06-20T08:23:32.811Z","dependency_job_id":"908eb4aa-f5f6-4654-95ce-2587bc0c56f5","html_url":"https://github.com/tnychn/mpv-discord","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnychn%2Fmpv-discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnychn%2Fmpv-discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnychn%2Fmpv-discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tnychn%2Fmpv-discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tnychn","download_url":"https://codeload.github.com/tnychn/mpv-discord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246413377,"owners_count":20773053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-rich-presence","golang","lua","mpv","rich-presence"],"created_at":"2024-08-01T05:00:57.018Z","updated_at":"2025-03-31T03:30:51.979Z","avatar_url":"https://github.com/tnychn.png","language":"Go","funding_links":[],"categories":["Social","Media"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003empv-discord\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\u003csmall\u003eDiscord Rich Presence Integration for MPV Media Player\u003c/small\u003e\u003c/b\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"1\" src=\"./1.png\" width=\"40%\" /\u003e\n  \u003cimg alt=\"2\" src=\"./2.png\" width=\"40%\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003e\u003cb\u003eLeft:\u003c/b\u003e looping song in playlist (mouse hovering on small icon)\u003c/sub\u003e\n  \u003cbr\u003e\n  \u003csub\u003e\u003cb\u003eRight:\u003c/b\u003e paused in movie\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/tnychn/mpv-discord/releases\"\u003e\u003cimg alt=\"github releases\" src=\"https://img.shields.io/github/v/release/tnychn/mpv-discord\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tnychn/mpv-discord/releases\"\u003e\u003cimg alt=\"release date\" src=\"https://img.shields.io/github/release-date/tnychn/mpv-discord\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/tnychn/mpv-discord/releases\"\u003e\u003cimg alt=\"downloads\" src=\"https://img.shields.io/github/downloads/tnychn/mpv-discord/total\"\u003e\u003c/a\u003e\n  \u003ca href=\"./LICENSE.txt\"\u003e\u003cimg alt=\"license\" src=\"https://img.shields.io/github/license/tnychn/mpv-discord\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n## Features\n\n* 🛠 Easy configuration\n* 📦 No third-party dependencies\n* 🚸 Simple installation (installer scripts included)\n* 🏁 Cross-platform (embrace my beloved Golang!)\n* ℹ️ Displays song metadata (title, artist, album)\n* ⏳ Displays real time player state and timestamps\n* 🔕 Toggle activation on the fly by key binding\n* 👻 Automatically hide when player is paused\n* 🖼 Customizable image assets\n\n## Why?\n\nCurrently, there are two alternatives I found on GitHub.\n\n1. [cniw/mpv-discordRPC](https://github.com/cniw/mpv-discordRPC)\n2. [noaione/mpv-discordRPC](https://github.com/noaione/mpv-discordRPC)\n\n**Discord RPC**\n\nIn order to interact with Discord Rich Presence using RPC, the client needs to connect to Discord's IPC socket.\nHowever, both of the above alternatives do not keep a connection with Discord's IPC socket, which I think is rather unreliable.\n\nSee also: [how _mpv-discord_ works](#how-it-works).\n\n**Third-party Dependencies**\n\nBoth of the above alternatives require users to install third-party dependencies such as `python-pypresence` or `lua-discordRPC`.\nI found it hard to set up the dependencies and I also don't want to mess up my environment.\n\n## Installation\n\nInstaller scripts for Windows, Linux and OSX are provided.\n\n1. Download .zip from [the latest release](https://github.com/tnychn/mpv-discord/releases/latest) and extract it.\n    * or you can download .zip by clicking on the green download button in GitHub\n    * or you can also use `git clone https://github.com/tnychn/mpv-discord.git`\n2. Run the installer script of your platform.\n    * run `install_darwin.sh` in Terminal for OSX\n    * run `install_linux.sh` in Terminal for Linux\n    * run `install_windows.bat` by double clicking on it for Windows\n3. Before using, you must specify `binary_path` in the config file first.\n\n## Configurations\n\nFor OSX and Linux, config file is located in `~/.config/mpv/script-opts`.\n\nFor Windows, config file is located in where the `mpv.exe` executable is.\n\n* **key** (default: `D`): key binding to toggle activation on the fly\n* **active** (default: `yes`): whether to activate at launch\n* **client_id**: specify your own client ID to [customize](#customization) the images shown in Rich Presence\n* **binary_path**: full path to mpv-discord's binary file\n* **socket_path** (default: `/tmp/mpvsocket`):\n  * `use_static_socket_path=yes`: set the full path to the static IPC socket path\n  * `use_static_socket_path=no`: set the full path to the directory placing the IPC socket with a *dynamic name*\n* **use_static_socket_path** (default: `yes`): whether to use static IPC socket path or *dynamic name* in the path\n* **autohide_threshold** (default: `0`): time in seconds before hiding the presence once player is paused (`0` is off)\n\n*dynamic name* is in the format of `mpv-discord-1234` where `1234` will be the PID of the mpv instance.\n\n## Customization\n\nGo to [Discord Developer Portal](https://discord.com/developers/applications),\ncreate an application and upload the following art assets with their corresponding asset keys:\n* `mpv`: large image (app logo)\n* `play`: small image used when playing\n* `pause`: small image used when paused\n* `loop`: small image used when playing and looping\n* `buffer`: small image used when buffering\n\nThen, set the `client_id` option in the config to the application ID.\n\nYou can also find the already provided client ids and their image assets [here](./assets/).\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"3\" src=\"./3.png\" width=\"30%\" /\u003e\n  \u003cimg alt=\"4\" src=\"./4.png\" width=\"50%\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003eUsing mpv-discord with IINA, a media player based on mpv.\u003c/sub\u003e\n  \u003cbr\u003e\n  \u003csub\u003eClient ID: 834116350884577280\u003c/sub\u003e\n\u003c/p\u003e\n\n## How It Works\n\nThis plugin consists of 3 files.\n\n1. [`discord.lua`](./scripts/discord.lua) -- mpv user script\n2. [`discord.conf`](./script-opts/discord.conf) -- configuration file\n3. [`mpv-discord` binary](./mpv-discord/main.go) -- backend binary of the plugin\n\nWhen mpv launches, mpv will run all the user scripts including `discord.lua`.\nThen `discord.lua` will read the configurations from `discord.conf` and do two things:\n(1) create an `input-ipc-server` socket of mpv. (2) start a subprocess of the `mpv-discord` binary.\nThen, `mpv-discord` will interact with the `input-ipc-server` to get the player state and properties of mpv.\nFinally, `mpv-discord` will update Discord's Rich Presence with the properties through Discord's IPC socket.\n\n## Contributing\n\nIf you have any ideas on how to improve this project or if you think there is a lack of features,\nfeel free to open an issue, or even better, open a pull request. All contributions are welcome!\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003csub\u003e\u003cstrong\u003e~ crafted with ♥︎ by tnychn ~\u003c/strong\u003e\u003c/sub\u003e\n  \u003cbr\u003e\n  \u003csub\u003e\u003cstrong\u003eMIT © 2024 Tony Chan\u003c/strong\u003e\u003c/sub\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnychn%2Fmpv-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftnychn%2Fmpv-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftnychn%2Fmpv-discord/lists"}