iamkroot / trakt-scrobbler

Scrobbler for trakt.tv that supports VLC, Plex, MPC-HC, and MPV.
https://github.com/iamkroot/trakt-scrobbler/wiki
GNU General Public License v2.0
466 stars 30 forks source link

[BUG] Can't run it with MPV, causes the error: No option 'input-ipc-server' in section: 'root' #258

Closed xcloudx01 closed 1 year ago

xcloudx01 commented 1 year ago

I'm trying to install it following the guide for MPV, but after following the steps an error occurs and scrobbling does not work. I've done "trakt init" to set it up with MPV, and "trakt test" shows a successful token. But run "trakts test mpv" and the following error occurs:

Testing connection with mpv.
Please ensure that mpv is playing some media.
Config value autoload failed for mpv.
Traceback (most recent call last):
  File "C:\Users\cloud\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 805, in get
    value = d[option]
            ~^^^^^^^^
  File "C:\Users\cloud\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py", line 1004, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cloud\AppData\Local\Programs\Python\Python311\Lib\collections\__init__.py", line 996, in __missing__
    raise KeyError(key)
KeyError: 'input-ipc-server'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\cloud\.local\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\monitor.py", line 82, in __new__
    cls.config = cls.autoload_cfg()
                 ^^^^^^^^^^^^^^^^^^
  File "C:\Users\cloud\.local\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\monitor.py", line 127, in autoload_cfg
    monitor_cfg[param] = param_loader()
                         ^^^^^^^^^^^^^^
  File "C:\Users\cloud\.local\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpv.py", line 73, in <lambda>
    "ipc_path": lambda: mpv_conf.get("root", "input-ipc-server")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\cloud\AppData\Local\Programs\Python\Python311\Lib\configparser.py", line 808, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'input-ipc-server' in section: 'root'
Could not start monitor for mpv
Hint: Try re-running trakts test with '-vvv' to enable more debug logging.

I'm on Win11. Is there any solution? Thanks

iamkroot commented 1 year ago

Looks like your mpv config is a bit weird. Could you please paste it here? Please make sure that you have set the input-ipc-server field in your mpv config as described in the setup.

xcloudx01 commented 1 year ago

Thank you! I had indeed forgotten to add the input-ipc-server field to my mpv.conf. It is working as expected now <3. Thanks again

The toast message is giving a minor error in the log whenever it pops up but it's no biggie, figured I'd paste it here for your reference if you wanted to look into it sometime:

2023-10-09 12:43:41,375 - ERROR - Thread-38 (_show_toast) - __init__ - Unhandled exception
TypeError: WPARAM is simple, so must be an int object (got NoneType)