All Projects → tnychn → mpv-discord

tnychn / mpv-discord

Licence: MIT license
🎈 A cross-platform Discord Rich Presence integration for mpv with no external dependencies.

Programming Languages

go
31211 projects - #10 most used programming language
lua
6591 projects
shell
77523 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to mpv-discord

csgo richpresence
Discord Rich Presence support for Counter-Strike: Global Offensive!
Stars: ✭ 16 (-80.72%)
Mutual labels:  rich-presence, discord-rich-presence
discoIPC
Connect to the local Discord IPC Socket, for features like Rich Presence.
Stars: ✭ 19 (-77.11%)
Mutual labels:  rich-presence, discord-rich-presence
Discord-RPC-Extension
Discord rich presence extension with open API.
Stars: ✭ 126 (+51.81%)
Mutual labels:  rich-presence, discord-rich-presence
mpv-gif-generator
Creates animated gifs using mpv hotkeys
Stars: ✭ 32 (-61.45%)
Mutual labels:  mpv
vscode-github-status
An extension that will sync your current workspace name and time spent on it to your GitHub status
Stars: ✭ 33 (-60.24%)
Mutual labels:  rich-presence
Discord-Netflix
A updated and improved version from the original Discord-Netflix from Nirewen.
Stars: ✭ 26 (-68.67%)
Mutual labels:  rich-presence
eclipse-discord-integration
Discord's Rich Presence Integration within Eclipse IDE
Stars: ✭ 41 (-50.6%)
Mutual labels:  discord-rich-presence
Discord-Rich-Presence-Party-Mode
Discord Rich Presence Tool. Party Mode | Cycle Mode integrated. The first to do it.
Stars: ✭ 18 (-78.31%)
Mutual labels:  discord-rich-presence
HPlayer2
Modular Media Player for Raspberry Pi and more...
Stars: ✭ 28 (-66.27%)
Mutual labels:  mpv
MyRPC
Distributed Discord RPC for @ everyone!
Stars: ✭ 14 (-83.13%)
Mutual labels:  discord-rich-presence
VR-reversal
VR-Reversal - Player for conversion of 3D video to 2D with optional saving of head tracking data and rendering out of 2D copies.
Stars: ✭ 128 (+54.22%)
Mutual labels:  mpv
vimsence
Discord rich presence for Vim
Stars: ✭ 46 (-44.58%)
Mutual labels:  rich-presence
feeluown-core
提供音乐播放器的一些常见组成模块(已经合并到 feeluown 项目中)
Stars: ✭ 30 (-63.86%)
Mutual labels:  mpv
dotfiles
My dotfiles for Bash/Zsh, Vim/Neovim, Doom Emacs, tmux, Git, terminal emulators, JupyterLab, aria2, mpv, Nix and Homebrew
Stars: ✭ 149 (+79.52%)
Mutual labels:  mpv
mpv-youtube-upnext
A userscript for MPV that allows you to play "up next"/recommended youtube videos ⏭️
Stars: ✭ 29 (-65.06%)
Mutual labels:  mpv
mpv-iptv
iptv script for mpv
Stars: ✭ 64 (-22.89%)
Mutual labels:  mpv
termv
A terminal iptv player written in bash
Stars: ✭ 119 (+43.37%)
Mutual labels:  mpv
StreamLinkerino
Twitch.tv client using only StreamLink, MPV, and Chatterino
Stars: ✭ 26 (-68.67%)
Mutual labels:  mpv
GroovyRP
Groove Music rich presence for Discord
Stars: ✭ 33 (-60.24%)
Mutual labels:  rich-presence
summertunes
A web-based music player for Beets
Stars: ✭ 15 (-81.93%)
Mutual labels:  mpv

mpv-discord

Discord Rich Presence Integration for MPV Media Player

1 2

Left: looping song in playlist (mouse hovering on small icon)
Right: paused in movie

github releases release date downloads license

Features

  • 🛠 Easy configuration
  • 📦 No third-party dependencies
  • 🚸 Simple installation (installer scripts included)
  • 🏁 Cross-platform (embrace my beloved Golang!)
  • ℹ️ Displays song metadata (title, artist, album)
  • Displays real time player state and timestamps
  • 🔕 Toggle activation on the fly by key binding
  • 👻 Automatically hide when player is paused
  • 🖼 Customizable image assets

Why?

Currently, there are two alternatives I found on GitHub.

  1. cniw/mpv-discordRPC
  2. noaione/mpv-discordRPC

Discord RPC

In order to interact with Discord Rich Presence using RPC, the client needs to connect to Discord's IPC socket. However, both of the above alternatives do not keep a connection with Discord's IPC socket, which I think is rather unreliable.

See also: how mpv-discord works.

Third-party Dependencies

Both of the above alternatives require users to install third-party dependencies such as python-pypresence or lua-discordRPC. I found it hard to set up the dependencies and I also don't want to mess up my environment.

Installation

Installer scripts for Windows, Linux and OSX are provided.

  1. Download .zip from the latest release and extract it.
    • or you can download .zip by clicking on the green download button in GitHub
    • or you can also use git clone https://github.com/tnychn/mpv-discord.git
  2. Run the installer script of your platform.
    • run install_darwin.sh in Terminal for OSX
    • run install_linux.sh in Terminal for Linux
    • run install_windows.bat by double clicking on it for Windows
  3. Before using, you must specify binary_path in the config file first.

Configurations

For OSX and Linux, config file is located in ~/.config/mpv/script-opts.

For Windows, config file is located in where the mpv.exe executable is.

  • key (default: D): key binding to toggle activation on the fly
  • active (default: yes): whether to activate at launch
  • client_id: specify your own client ID to customize the images shown in Rich Presence
  • binary_path: full path to mpv-discord's binary file
  • socket_path (default: /tmp/mpvsocket):
    • use_static_socket_path=yes: set the full path to the static IPC socket path
    • use_static_socket_path=no: set the full path to the directory placing the IPC socket with a dynamic name
  • use_static_socket_path (default: yes): whether to use static IPC socket path or dynamic name in the path
  • autohide_threshold (default: 0): time in seconds before hiding the presence once player is paused (0 is off)

dynamic name is in the format of mpv-discord-1234 where 1234 will be the PID of the mpv instance.

Customization

Go to Discord Developer Portal, create an application and upload the following art assets with their corresponding asset keys:

  • mpv: large image (app logo)
  • play: small image used when playing
  • pause: small image used when paused
  • loop: small image used when playing and looping
  • buffer: small image used when buffering

Then, set the client_id option in the config to the application ID.

You can also find the already provided client ids and their image assets here.

3 4

Using mpv-discord with IINA, a media player based on mpv.
Client ID: 834116350884577280

How It Works

This plugin consists of 3 files.

  1. discord.lua -- mpv user script
  2. discord.conf -- configuration file
  3. mpv-discord binary -- backend binary of the plugin

When mpv launches, mpv will run all the user scripts including discord.lua. Then discord.lua will read the configurations from discord.conf and do two things: (1) create an input-ipc-server socket of mpv. (2) start a subprocess of the mpv-discord binary. Then, mpv-discord will interact with the input-ipc-server to get the player state and properties of mpv. Finally, mpv-discord will update Discord's Rich Presence with the properties through Discord's IPC socket.

Contributing

If you have any ideas on how to improve this project or if you think there is a lack of features, feel free to open an issue, or even better, open a pull request. All contributions are welcome!


Made with ♥︎ by tnychn
MIT © 2021 Tony Chan

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].