Giter Site home page Giter Site logo

cniw / mpv-discordrpc Goto Github PK

View Code? Open in Web Editor NEW
133.0 133.0 10.0 2.78 MB

Discord Rich Presence integration for mpv Media Player

License: MIT License

Lua 70.37% Shell 19.73% Batchfile 5.06% Python 4.84%
discord discord-rich-presence discord-rpc linux lua lua-script luajit mac mpv mpv-discordrpc mpv-media-player mpv-script osx python python3 rich-presence script windows

mpv-discordrpc's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mpv-discordrpc's Issues

module 'ffi' not found

[mpv_discordRPC] Discord Rich Presence integration for mpv Media Player 
[mpv_discordRPC] Upstream: https://github.com/cniw/mpv-discordRPC 
[mpv_discordRPC] Version: 1.4.1-UNKNOWN 
 (+) Video --vid=1 (*) (vp9 1920x1080 29.970fps)
 (+) Audio --aid=1 --alang=eng (*) (aac 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
[mpv_discordRPC] 
[mpv_discordRPC] stack traceback:
[mpv_discordRPC] 	[C]: in function 'require'
[mpv_discordRPC] 	...nd/.config/mpv/scripts/mpv-discordRPC/lua-discordRPC.lua:1: in main chunk
[mpv_discordRPC] 	[C]: in function 'require'
[mpv_discordRPC] 	[string "/home/uend/.config/mpv/scripts/mpv-discordRPC..."]:228: in function 'cb'
[mpv_discordRPC] 	mp.defaults:351: in function 'process_timers'
[mpv_discordRPC] 	mp.defaults:520: in function 'dispatch_events'
[mpv_discordRPC] 	mp.defaults:493: in function <mp.defaults:492>
[mpv_discordRPC] 	[C]: in ?
[mpv_discordRPC] 	[C]: in ?
[mpv_discordRPC] Lua error: ...nd/.config/mpv/scripts/mpv-discordRPC/lua-discordRPC.lua:1: module 'ffi' not found:
[mpv_discordRPC] 	no field package.preload['ffi']
[mpv_discordRPC] 	no file '/home/uend/.config/mpv/scripts/mpv-discordRPC/ffi.lua'
[mpv_discordRPC] 	no file '/usr/local/share/lua/5.2/ffi.lua'
[mpv_discordRPC] 	no file '/usr/local/share/lua/5.2/ffi/init.lua'
[mpv_discordRPC] 	no file '/usr/local/lib/lua/5.2/ffi.lua'
[mpv_discordRPC] 	no file '/usr/local/lib/lua/5.2/ffi/init.lua'
[mpv_discordRPC] 	no file '/usr/share/lua/5.2/ffi.lua'
[mpv_discordRPC] 	no file '/usr/share/lua/5.2/ffi/init.lua'
[mpv_discordRPC] 	no file '/usr/local/lib/lua/5.2/ffi.so'
[mpv_discordRPC] 	no file '/usr/lib/x86_64-linux-gnu/lua/5.2/ffi.so'
[mpv_discordRPC] 	no file '/usr/lib/lua/5.2/ffi.so'
[mpv_discordRPC] 	no file '/usr/local/lib/lua/5.2/loadall.so'

Doesn't work with Apple Silicon Macs

When trying to use on M1 MacBook Air, I get this error:

[mpv_discordRPC] Lua error: ...wl/.config/mpv/scripts/mpv-discordRPC/lua-discordRPC.lua:2: dlopen(libdiscord-rpc.dylib, 0x0005): tried: '/usr/lib/swift/libdiscord-rpc.dylib' (no such file), '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libdiscord-rpc.dylib' (no such file), 'libdiscord-rpc.dylib' (no such file), '/usr/local/lib/libdiscord-rpc.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/lib/libdiscord-rpc.dylib' (no such file), '/Users/wl/libdiscord-rpc.dylib' (no such file)

Cover art leaking stream URL

When hovering over the cover art for a web stream, it shows the URL, and afaik there is no way to hide that.
It is usually not a big deal but for my IPTV provider it leaks my login information. I know it's a bad design on their part but might be useful in other scenarios as well.
Image illustrating: example

ImportError: No module named pypresence

Hello,
I am trying to use this on a fresh install of Kubuntu 19.10 but for some reason pypresence is giving me issues. When running mpv from the terminal, I can see the script is giving this error over and over:
Traceback (most recent call last): File "/home/user/.config/mpv/scripts/mpv-discordRPC/python-pypresence.py", line 6, in <module> import pypresence ImportError: No module named pypresence
However, pypresence IS installed. Python 3 is at version 3.7.5. and pip3 list shows pypresence 3.3.2 is there. Further, if I open a terminal and manually run python3 and then import pypresence, it works just fine.

Segmentation fault on mpv while using the mpv-discordRPC

I have been getting segmentation fault pretty much after playing a song for 5-10 min

Which I didn't really get before.

mpv --no-video --loop STUDY\ WITH\ ME\ 24\ HOURS\ ๐Ÿ’ง\ lofi\ Music\ ๏ฝœ\ Lofi\ Study\ ๏ฝœ\ Chill\ music\ ~\ 35\ min\ study\ x\ 15\ min\ chill\ [Tq7523sJc6I].opus
[mpv_discordRPC] Discord Rich Presence integration for mpv Media Player
[mpv_discordRPC] Upstream: https://github.com/cniw/mpv-discordRPC
[mpv_discordRPC] Version: 1.4.1-UNKNOWN
(+) Audio --aid=1 --alang=eng 'STUDY WITH ME 24 HOURS ๐Ÿ’ง lofi Music | Lofi Study | Chill music ~ 35 min study x 15 min chill' (opus 2ch 48000Hz)
File tags:
Artist: Mimi Lofi Chill
Comment: https://www.youtube.com/watch?v=Tq7523sJc6I
Date: 20230114
Title: STUDY WITH ME 24 HOURS ๐Ÿ’ง lofi Music | Lofi Study | Chill music ~ 35 min study x 15 min chill
AO: [pipewire] 48000Hz stereo 2ch floatp
zsh: segmentation fault (core dumped) mpv --no-video --loop

intermittent issue cause mpv to hang on exit

Hi, im currently having a issue where mpv hangs on exit sometimes, I have only just opened GDB to see where it is getting stuck and it seems to be on the closing on the RPC connection in the discord provided RPC library. I am not sure if this is a upstream issue or an issue with how mpv-discordRPC tells the libary to quit

image

I need help

When using a custom appID and state, every 15 seconds the status will go back to the default title and (Playing) state, and then turn back after a second. It's super frustrating, so if anyone has a fix please let me know.

Time left continues to decrease when the mpv is paused

On Windows 10,
mpv version 0.32.0-288-gee70e8ce50
and mpv-discordRPC version 1.4.1-UNKNOWN
I did not change any settings after installation.

When mpv is paused, Discord presence updates properly to show that the player is paused, but the remaining time continues ticking down, for around 15 seconds, after which, it jumps back to the proper time and continues ticking down.

e.g.:

  • I paused a movie with mpv showing 04:22:47 left;
  • Discord presence shows the paused icon but the "xx:xx:xx left" text continues ticking down
  • Once the timer reaches "04:22:31 left", after one second, it jumps back to "04:22:45 left" and continues this countdown loop.

Everything else works fine i.e. the current timestamp ("AV:") does not change while the time left counter is ticking down.

Here's a screen recording from the Discord desktop app to better illustrate my issue (username and tag blurred for privacy):

mpv-discordRPC

Starts but doesn't send to discord

[mpv_discordRPC] Discord Rich Presence integration for mpv Media Player
[mpv_discordRPC] Upstream: https://github.com/cniw/mpv-discordRPC
[mpv_discordRPC] Version: 1.4.1-UNKNOWN
(+) Video --vid=1 () (h264 1520x1080 23.976fps)
(+) Audio --aid=1 --alang=jpn (
) (aac 2ch 48000Hz)
File tags:
Title: [Kagura] Serial Experiments Lain - 01 [BDRip 1520x1080 x264 Hi10P FLAC]
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1520x1080 yuv420p
AV: 00:01:39 / 00:23:56 (7%) A-V: 0.000042 Vb: 2.602 mbps Ab: 161 kbps

module 'ffi' not found

I'm having trouble running this, when i try to run mpv, it shows me this:

[mpv_discordRPC] Lua error: ...su/.config/mpv/scripts/mpv-discordRPC/lua-discordRPC.lua:1: module 'ffi' not found: [mpv_discordRPC] no field package.preload['ffi'] [mpv_discordRPC] no file '/home****/.config/mpv/scripts/mpv-discordRPC/ffi.lua' [mpv_discordRPC] no file '/usr/share/lua/5.2/ffi.lua' [mpv_discordRPC] no file '/usr/share/lua/5.2/ffi/init.lua' [mpv_discordRPC] no file '/usr/lib/lua/5.2/ffi.lua' [mpv_discordRPC] no file '/usr/lib/lua/5.2/ffi/init.lua' [mpv_discordRPC] no file '/usr/lib/lua/5.2/ffi.so' [mpv_discordRPC] no file '/usr/lib/lua/5.2/loadall.so'

Tried several things, couldn't get the script working.

Manjaro Linux 5.6.10-3
mpv 0.32.0
Lua 5.3.5

Running this script with -v, i see the following error...

[cplayer] Can't load unknown script: /home/user/.config/mpv/scripts/mpv-discordRPC

The scripts are correctly there. I tried referencing main.lua directly using --script=... but that ended up failing to import the catalogs.lua script.

Then I tried moving catalogs.lua and the other lua script into the PWD, I had the config file point to python, but for some reason it wasn't respecting the scripts-opt folder and tried to run the lua script (which failed because I don't have ffi installed).

I was wondering if this was related to mpv-player/mpv#7399

Cover art doesn't work.

Hi, it seems that after getting the basic functionalities of this to work, the cover art doesn't show up for any of my songs.

Recent mpv changes

Hi,

with the recent changes in MPV regarding scripts, this stopped working with the following errors (tested with mpv-x86_64-20200202-git-77a74d9):

   cplayer: Cannot find main.* for any supported scripting backend in: C:/Program Files/MPV/scripts/mpv-discordRPC

mpv_discordRPC: Discord Rich Presence integration for mpv Media Player
mpv_discordRPC: Upstream: https://github.com/cniw/mpv-discordRPC
mpv_discordRPC: Version: 1.4.1

mpv_discordRPC:
mpv_discordRPC: stack traceback:
mpv_discordRPC:         C:/Program Files/MPV/scripts/mpv-discordRPC.lua:126: in function 'cb'
mpv_discordRPC:         mp.defaults:346: in function 'process_timers'
mpv_discordRPC:         mp.defaults:506: in function 'dispatch_events'
mpv_discordRPC:         mp.defaults:479: in function <mp.defaults:478>
mpv_discordRPC:         [C]: at 0x00d18430
mpv_discordRPC:         [C]: at 0x00d17b00
mpv_discordRPC: Lua error: C:/Program Files/MPV/scripts/mpv-discordRPC.lua:126: module 'mpv-discordRPC.catalogs' not found:
mpv_discordRPC:         no field package.preload['mpv-discordRPC.catalogs']
mpv_discordRPC:         no file '.\mpv-discordRPC\catalogs.lua'
mpv_discordRPC:         no file 'C:\Program Files\MPV\lua\mpv-discordRPC\catalogs.lua'
mpv_discordRPC:         no file 'C:\Program Files\MPV\lua\mpv-discordRPC\catalogs\init.lua'
mpv_discordRPC:         no file '.\mpv-discordRPC\catalogs.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\mpv-discordRPC\catalogs.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\loadall.dll'
mpv_discordRPC:         no file '.\mpv-discordRPC.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\mpv-discordRPC.dll'
mpv_discordRPC:         no file 'C:\Program Files\MPV\loadall.dll'

This however can be easily fixed.
The files from "scripts\mpv-discordRPC" just need to be placed into the directory "lua\mpv-discordRPC" (or as above, in any other of the named directories, but the "lua" ones seems the most elegant, however the "lua" directory needs to be created if not already present).
Perhaps this can be considered with the installer script.

After recent changes I get this error messages in console

  • mpv-x86_64-20200426-git-640db1e
  • mpv-discordRPC-1.4.1-UNKNOWN-win

Log (colorized):

- Can't load unknown script: C:\Users\X4\AppData\Roaming/mpv/scripts/mpv-discordRPC_pypresence.py
! [mpv_discordRPC] script-opts/mpv_discordRPC.conf:21 unknown key mpv_version, ignoring
[mpv_discordRPC] Discord Rich Presence integration for mpv Media Player
[mpv_discordRPC] Upstream: https://github.com/cniw/mpv-discordRPC
[mpv_discordRPC2] Discord Rich Presence integration for mpv Media Player
[mpv_discordRPC] Version: 1.4.1
[mpv_discordRPC2] Upstream: https://github.com/cniw/mpv-discordRPC
[mpv_discordRPC2] Version: 1.4.1-UNKNOWN

I have no issues with using python version (tried it as well before), but I still use lua, however mpv now after update throwing errors about this file.
Also it have some problems with mpv_version variable, may be need to rename it?

lua error

Can't seem to get it working anymore. Following the install script and editing the config to use pypresence gives this error:

[mpv_discordRPC_lua_discordRPC]
[mpv_discordRPC_lua_discordRPC] stack traceback:
[mpv_discordRPC_lua_discordRPC] [C]: in function 'require'
[mpv_discordRPC_lua_discordRPC] ...in/.config/mpv/scripts/mpv-discordRPC_lua-discordRPC.lua:1: in main chunk
[mpv_discordRPC_lua_discordRPC] [C]: in ?
[mpv_discordRPC_lua_discordRPC] [C]: in ?
[mpv_discordRPC_lua_discordRPC] Lua error: ...in/.config/mpv/scripts/mpv-discordRPC_lua-discordRPC.lua:1: module 'ffi' not found:
[mpv_discordRPC_lua_discordRPC] no field package.preload['ffi']
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/share/lua/5.2/ffi.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/share/lua/5.2/ffi/init.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/lib/lua/5.2/ffi.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/lib/lua/5.2/ffi/init.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/share/lua/5.2/ffi.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/share/lua/5.2/ffi/init.lua'
[mpv_discordRPC_lua_discordRPC] no file './ffi.lua'
[mpv_discordRPC_lua_discordRPC] no file '/home/lain/.config/mpv/scripts/ffi.lua'
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/lib/lua/5.2/ffi.so'
[mpv_discordRPC_lua_discordRPC] no file '/usr/lib/x86_64-linux-gnu/lua/5.2/ffi.so'
[mpv_discordRPC_lua_discordRPC] no file '/usr/lib/lua/5.2/ffi.so'
[mpv_discordRPC_lua_discordRPC] no file '/usr/local/lib/lua/5.2/loadall.so'
[mpv_discordRPC_lua_discordRPC] no file './ffi.so'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.