iamkroot/trakt-scrobbler

[BUG] Issue when starting trakts

Opened this issue · 5 comments

System Info

  • OS and Version: Windows 11 Pro 23H2
  • Python Version: 3.12.1
  • Player and Version: MPC-BE x64 1.6.11

Description

2023-12-30_21-58-44_650

2023-12-30_21-59-00_651

To Reproduce

Steps to reproduce the behavior:

  1. Install pipx install --force git+https://github.com/iamkroot/trakt-scrobbler.git@master
  2. Execute trakts run

Log file

Click to see log contents

2023-12-30 21:51:56,175 - DEBUG - MainThread - notifier - Notifications enabled for categories: exception, misc, scrobble.pause, scrobble.resume, scrobble.start, scrobble.stop, trakt
2023-12-30 21:51:56,176 - INFO - notify_loop - notifier - Starting notif loop
2023-12-30 21:51:56,176 - DEBUG - MainThread - notifier - Notif actions enabled for categories: exception, misc, scrobble.pause, scrobble.resume, scrobble.start, scrobble.stop, trakt
2023-12-30 21:51:56,333 - INFO - MainThread - scrobbler - Started scrobbler thread.
2023-12-30 21:51:56,341 - ERROR - MainThread - monitor - Config value autoload failed for mpc-be.
Traceback (most recent call last):
  File "C:\Users\flameshikari\AppData\Local\pipx\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\flameshikari\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\monitor.py", line 112, in autoload_cfg
    loaders = getattr(cls, "read_player_cfg")(auto_keys)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\flameshikari\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpc.py", line 84, in read_player_cfg
    return cls._read_registry_cfg((path1, key1), (path2, key2))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\flameshikari\AppData\Local\pipx\pipx\venvs\trakt-scrobbler\Lib\site-packages\trakt_scrobbler\player_monitors\mpc.py", line 40, in _read_registry_cfg
    error.filename = ",".join(paths)
                     ^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, tuple found
2023-12-30 21:51:56,347 - WARNING - MainThread - main - Could not start monitor for mpc-be
2023-12-30 21:51:56,348 - CRITICAL - MainThread - main - Exiting scrobbler - no more monitors

Have you enabled the web interface from the mpcbe Options?

Yes.

image

Then the next step would be checking the Registry to figure out where the setting is being stored-

  1. Open the Registry Editor from start (or regedit exec)
  2. Navigate to HKEY_CURRENT_USER\Software\MPC-BE from the tree-view panel on the left
  3. Try to find a WebServerPort key somewhere in there.

I found the issue. I installed MPC-BE via scoop, it stores settings in Player folder instead of Registry by default. Changing settings location to Registry fixes the issue. Is it worth mentioning this in the installation guide?

2024-01-02_14-07-09_657

Interesting, this seems to be a recent addition to MPC-BE. From what I recall, MPC (and MPCHC) only use the registry.
Rather than changing the mode to registry, you could also use trakts config set players.mpc-be.port 13579 to manually specify the port number.

On our end, we should support auto-detecting the values from any of these. Will leave this as a TODO.