Code Monkey home page Code Monkey logo

trakt-scrobbler's Introduction

Trakt Scrobbler

A trakt.tv scrobbler for your computer.

What is Trakt?

Automatically scrobble TV show episodes and movies you are watching to Trakt.tv! It is a website that keeps a history of everything you've watched!

What is trakt-scrobbler?

trakt-scrobbler is an application that runs in the background and monitors your media players for any new activity. When it detects some file being played, it determines the media info (such as name of the movie/show, episode number, etc.) and sends this to trakt.tv servers, so that it can be marked as "Currently Watching" on your profile. No manual intervention required!

Features

  • Full featured command line interface to control the service. Just run trakts.
  • Automatic media info extraction using guessit.
  • Scrobbling is independent of the player(s) where the media is played. Support for new players can thus be easily added.
  • Currently supports:
    • VLC (via web interface)
    • Plex (doesn't require Plex Pass)
    • MPV (via IPC server)
    • MPC-BE/MPC-HC (via web interface).
  • Folder whitelisting: Only media files from subdirectories of these folders are synced with trakt.
  • Optionally, you can receive a quick notification that the media start/pause/stop activity has been scrobbled.
  • For cases when it misidentifies the files, you can specify a regex to manually extract the necessary details.
  • Proxy support: Optionally specify a proxy server to handle all communication with trakt servers!

Getting Started

Head over to the wiki for further details.

Contributing

Feel free to create a new issue in case you find a bug/want to have a feature added. See CONTRIBUTING.md for more details. Proper PRs are welcome.

Acknowledgements

trakt-scrobbler's People

Contributors

ahmubashshir avatar brutuz avatar dependabot[bot] avatar dyphire avatar edwardbetts avatar gmfalka avatar iamkroot avatar jrfarmer avatar m4tx avatar ms-test2 avatar prabapro avatar riccoyu avatar sharkykh avatar sp3eder avatar stillness9560 avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trakt-scrobbler's Issues

[BUG] Problem Connecting Plex Server

Describe the bug
Using the latest release of plex server and the software on a Mac the daemon is crashing when trying to connect to the Plex server.

Error is an unhandled exception when trying to write the plex_token.json file.

Desktop (please complete the following information):

  • OS: MacOS 19.15.3
  • Python Version: homebrew installed Python 3.7.7
  • Player Plex Server
  • Player Version Version 4.22.2, installed via homebrew

One note - installing poetry via curl failed, installed via homebrew

To Reproduce
Steps to reproduce the behavior

  1. setup config file to use Plex and VLC
  2. Left plex config as defaults
  3. ran install
  4. rebooted
  5. Went and looked at log file and found error.

Log file

2020-03-21 21:30:15,556 - ERROR - MainThread - main - Unhandled exception Traceback (most recent call last): File "main.py", line 80, in main() File "main.py", line 73, in main mon = Mon(scrobble_queue) File "/Users/tshott/Library/trakt-scrobbler/player_monitors/plex.py", line 45, in __init__ self.token = get_token(**plex_conf) File "/Users/tshott/Library/trakt-scrobbler/player_monitors/plex.py", line 32, in get_token write_json({"token": token}, PLEX_TOKEN_PATH) File "/Users/tshott/Library/trakt-scrobbler/utils.py", line 37, in write_json json.dump(data, f, indent=4) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 179, in dump for chunk in iterable: File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 431, in _iterencode yield from _iterencode_dict(o, _current_indent_level) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 405, in _iterencode_dict yield from chunks File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 438, in _iterencode o = _default(o) File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.__class__.__name__} ' TypeError: Object of type Response is not JSON serializable

[BUG] Config.toml doesn't accept "é" character and probably others as well

Describe the bug
Ok, below is my current working setup. I don't have all the log files, but I did lots of testing and I'm pretty sure I've isolated this problem: whenever I tried to whitelist a path in config.toml, if it included the "é" character, the log would say that the file was not whitelisted.

My final test was simply changing "C:/Users/Fabio/Videos/Séries/" in the whitelist to "C:/Users/Fabio/Videos/" (all testing was done by reinstalling everything from scratch, no leftovers), this simple change made everything work as intended (thanks, btw). I'm guessing somewhere in the process this character breaks it.

Desktop (please complete the following information):

  • OS: Windows 10 1903
  • Python Version: 3.7.4
  • Player: MPC-HC
  • Player Version: 1.8.8

Config.toml

Click to see log contents

[general]
enable_notifs = true

[fileinfo]
whitelist = [
	"C:/Users/Fabio/Videos/"
]

[players]
monitored = ['mpchc', 'mpv']  # players to be monitored. Allowed: 'mpcbe', 'mpchc', 'mpv', 'vlc'
skip_interval = 5  # min percent jump to consider for scrobbling to trakt

[players.mpcbe]  # enable web interface from options
ip = "localhost"
port = "13579"  # from Options -> Player -> Web Interface -> Listen on port  (ensure it is ticked) 
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpchc]  # enable web interface from options
ip = "localhost"
port = "13579"  # if both mpchc and mpcbe are to be monitored, then ensure that their ports are different
poll_interval = 10  # in seconds

[players.vlc]  # enable web interface from options
ip = "localhost"
port = "8080"  # from Preferences -> All -> Input/Codecs -> HTTP Server Port
password = "password"  # from Preferences -> All -> Interface -> Main Interfaces -> Lua -> Lua HTTP Password
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpv]  # enable the JSON IPC server. Either via cmd line arg (eg: --input-ipc-server=\\.\pipe\mpvpipe), or in mpv.conf file
ipc_path = '\\.\pipe\mpvpipe'  # windows (single quotes are important)
# ipc_path = "/tmp/mpvsocket"  # unix

[BUG] No module named 'appdirs'

Hello,

I'm trying to setup the scrobble on my computer, but it doesn't seem to work.

Information about my computer:

  • OS: Debian Buster
  • Python Version: 3.7.3

When I try to exeute the script I have the following error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/florian/.local/trakt-scrobbler/trakt_interface.py", line 7, in <module>
    from app_dirs import DATA_DIR
  File "/home/florian/.local/trakt-scrobbler/app_dirs.py", line 1, in <module>
    import appdirs
ModuleNotFoundError: No module named 'appdirs'

So, I've looked if that module appdirs is installed, it seems to be the case:

$ pip list --user
Package         Version   
--------------- ----------
appdirs         1.4.3     
argcomplete     1.11.0    
babelfish       0.5.5     
certifi         2019.11.28
Click           7.0       
distro          1.4.0     
guessit         3.1.0     
idna            2.8       
pip             19.3.1    
pipx            0.14.0.0  
python-dateutil 2.8.1     
rebulk          2.0.0     
requests        2.22.0    
six             1.13.0    
toml            0.10.0    
urllib3         1.25.7    
userpath        1.3.0

Anyone ever faced this issue before ?

Thanks :)

Install script fails

Describe the bug
Install script fails

Desktop (please complete the following information):

  • OS: Windows 10
  • Python Version: 3.8.1
  • Player VLC
  • Player Version 3.0.8

To Reproduce
Steps to reproduce the behavior:

python install.py
CMD Op C:\Users\utkar\Documents\trakt-scrobbler-master\tools>python install.py Starting installation for trakt-scrobbler Installing to C:\Users\utkar\AppData\Local\trakt-scrobbler 'poetry' is not recognized as an internal or external command, operable program or batch file. config.toml already exists in C:\Users\utkar\AppData\Roaming\trakt-scrobbler. Please ensure that it matches sample_config.toml, or the app may crash unexpectedly. Validating config file at C:\Users\utkar\AppData\Roaming\trakt-scrobbler 'poetry' is not recognized as an internal or external command, operable program or batch file. Invalid config file!

Log file

None Generated

None Generated

[BUG] Searching cache, unhandled exception.

Hello @iamkroot!

Found an unhandled exception in the logs.
Its just an FYI report, i dont think theres so many shows/movies with names like that. :)

The show title is 9-1-1.
and the guessit module found it as

MatchesDict([('title', ['9', '1-1'])

Probably why it throw the script off its rails

 - DEBUG - mpchc - file_info - Filepath X:\9-1-1.S03E06.1080p.WEB.x264-TBS\9-1-1.s03e06.1080p.web.x264-tbs.mkv
 - DEBUG - mpchc - file_info - Trying to match custom regex.
 - DEBUG - mpchc - file_info - No regex matches for X:/9-1-1.S03E06.1080p.WEB.x264-TBS/9-1-1.s03e06.1080p.web.x264-tbs.mkv
 - DEBUG - mpchc - file_info - Using guessit module to match.
 - DEBUG - mpchc - file_info - MatchesDict([('title', ['9', '1-1']), ('season', 3), ('episode', 6), ('screen_size', '1080p'), ('source', 'Web'), ('video_codec', 'H.264'), ('release_group', 'tbs'), ('container', 'mkv'), ('mimetype', 'video/x-matroska'), ('type', 'episode')])
 - DEBUG - scrobbler - trakt_interface - Searching cache.
 - ERROR - scrobbler - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\username\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\username\AppData\Local\trakt-scrobbler\scrobbler.py", line 26, in run
    self.scrobble(*scrobble_item)
  File "C:\Users\username\AppData\Local\trakt-scrobbler\scrobbler.py", line 30, in scrobble
    if trakt.scrobble(verb, **data):
  File "C:\Users\username\AppData\Local\trakt-scrobbler\trakt_interface.py", line 185, in scrobble
    scrobble_data = prepare_scrobble_data(**media_info)
  File "C:\Users\username\AppData\Local\trakt-scrobbler\trakt_interface.py", line 169, in prepare_scrobble_data
    trakt_id = get_trakt_id(title, type)
  File "C:\Users\username\AppData\Local\trakt-scrobbler\trakt_interface.py", line 147, in get_trakt_id
    trakt_id = trakt_cache[required_type].get(title)
TypeError: unhashable type: 'list'

Issue when installing

OS: Windows 7 Home Premium x64
Python Version: 3.7.3 x64 (checked "add to system path" when installing)
Player: MPC-HC (Nightly, 64-bit) 1.8.6.8 (bf1f52f12)

When i run scripts\windows-install.bat i get this screen, pipenv is already installed as you can see...
image

[BUG] Package installation failed mac

[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1874, in do_install
[pipenv.exceptions.InstallError]:       keep_outdated=keep_outdated
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]:       retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting dbus-python==1.2.8 (from -r /var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pipenv-6mnkla1b-requirements/pipenv-cj6hmexw-requirement.txt (line 1))', '  Using cached https://files.pythonhosted.org/packages/3f/e7/4edb582d1ffd5ac3c84188deea32e960b5c8c0fe1da56ce70224f85ce542/dbus-python-1.2.8.tar.gz', 'Building wheels for collected packages: dbus-python', '  Building wheel for dbus-python (setup.py): started', "  Building wheel for dbus-python (setup.py): finished with status 'error'", '  Running setup.py clean for dbus-python', 'Failed to build dbus-python', 'Installing collected packages: dbus-python', '  Running setup.py install for dbus-python: started', "    Running setup.py install for dbus-python: finished with status 'error'"]
[pipenv.exceptions.InstallError]: ['ERROR: Command errored out with exit status 1:', '   command: /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-wheel-0ph92kr0 --python-tag cp37', '       cwd: /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/', '  Complete output (154 lines):', '  running bdist_wheel', '  running build', '  creating /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build', '  creating /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7', '  checking whether make supports nested variables... yes', '  checking whether to enable maintainer-specific portions of Makefiles... no', '  checking for gcc... gcc', '  checking whether the C compiler works... yes', '  checking for C compiler default output file name... a.out', '  checking for suffix of executables...', '  checking whether we are cross compiling... no', '  checking for suffix of object files... o', '  checking whether we are using the GNU C compiler... yes', '  checking whether gcc accepts -g... yes', '  checking for gcc option to accept ISO C89... none needed', '  checking whether gcc understands -c and -o together... yes', '  checking how to run the C preprocessor... gcc -E', '  checking for grep that handles long lines and -e... /usr/bin/grep', '  checking for egrep... /usr/bin/grep -E', '  checking for ANSI C header files... yes', '  checking for sys/types.h... yes', '  checking for sys/stat.h... yes', '  checking for stdlib.h... yes', '  checking for string.h... yes', '  checking for memory.h... yes', '  checking for strings.h... yes', '  checking for inttypes.h... yes', '  checking for stdint.h... yes', '  checking for unistd.h... yes', '  checking minix/config.h usability... no', '  checking minix/config.h presence... no', '  checking for minix/config.h... no', '  checking whether it is safe to define __EXTENSIONS__... yes', '  checking for a BSD-compatible install... /usr/bin/install -c', '  checking whether build environment is sane... yes', '  checking for a thread-safe mkdir -p... /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build-aux/install-sh -c -d', '  checking for gawk... no', '  checking for mawk... no', '  checking for nawk... no', '  checking for awk... awk', '  checking whether make sets $(MAKE)... yes', '  checking for style of include used by make... GNU', "  checking whether UID '501' is supported by ustar format... yes", "  checking whether GID '20' is supported by ustar format... yes", '  checking how to create a ustar tar archive... gnutar', '  checking dependency style of gcc... gcc3', '  checking build system type... x86_64-apple-darwin18.7.0', '  checking host system type... x86_64-apple-darwin18.7.0', '  checking for native Windows host... no', '  checking how to print strings... printf', '  checking for a sed that does not truncate output... /usr/bin/sed', '  checking for fgrep... /usr/bin/grep -F', '  checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld', '  checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no', '  checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B', '  checking the name lister (/usr/bin/nm -B) interface... BSD nm', '  checking whether ln -s works... yes', '  checking the maximum length of command line arguments... 196608', '  checking how to convert x86_64-apple-darwin18.7.0 file names to x86_64-apple-darwin18.7.0 format... func_convert_file_noop', '  checking how to convert x86_64-apple-darwin18.7.0 file names to toolchain format... func_convert_file_noop', '  checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r', '  checking for objdump... objdump', '  checking how to recognize dependent libraries... pass_all', '  checking for dlltool... no', '  checking how to associate runtime and link libraries... printf %s\\n', '  checking for ar... ar', '  checking for archiver @FILE support... no', '  checking for strip... strip', '  checking for ranlib... ranlib', '  checking command to parse /usr/bin/nm -B output from gcc object... ok', '  checking for sysroot... no', '  checking for a working dd... /bin/dd', '  checking how to truncate binary pipes... /bin/dd bs=4096 count=1', '  checking for mt... no', '  checking if : is a manifest tool... no', '  checking for dsymutil... dsymutil', '  checking for nmedit... nmedit', '  checking for lipo... lipo', '  checking for otool... otool', '  checking for otool64... no', '  checking for -single_module linker flag... yes', '  checking for -exported_symbols_list linker flag... yes', '  checking for -force_load linker flag... yes', '  checking for dlfcn.h... yes', '  checking for objdir... .libs', '  checking if gcc supports -fno-rtti -fno-exceptions... yes', '  checking for gcc option to produce PIC... -fno-common -DPIC', '  checking if gcc PIC flag -fno-common -DPIC works... yes', '  checking if gcc static flag -static works... no', '  checking if gcc supports -c -o file.o... yes', '  checking if gcc supports -c -o file.o... (cached) yes', '  checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes', '  checking dynamic linker characteristics... darwin18.7.0 dyld', '  checking how to hardcode library paths into programs... immediate', '  checking whether stripping libraries is possible... yes', '  checking if libtool supports shared libraries... yes', '  checking whether to build shared libraries... yes', '  checking whether to build static libraries... no', '  checking for inline... inline', '  checking for gawk... (cached) awk', '  checking for python... /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7', "  checking for a version of Python >= '2.1.0'... yes", "  checking for a version of Python >= '2.7'... yes", '  checking for the distutils Python package... yes', '  checking for Python include path... -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m', '  checking for Python library path... -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib -lpython3.7m', '  checking for Python site-packages path... /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages', '  checking python extra libraries... -ldl  -framework CoreFoundation', '  checking python extra linking flags... -Wl,-stack_size,1000000  -framework CoreFoundation /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python', '  checking consistency of all components of python development environment... yes', '  checking for python version... 3.7', '  checking for python platform... darwin', '  checking for python script directory... ${prefix}/lib/python3.7/site-packages', '  checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages', '  checking for git... /usr/bin/git', '  checking python3.7 module: sphinx... no', '  checking python3.7 module: sphinx_rtd_theme... no', '  checking for dbus-run-session... /usr/local/bin/dbus-run-session', '  checking for pkg-config... no', '  checking for DBUS... no', "  configure: error: in `/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7':", '  configure: error: The pkg-config script could not be found or is too old.  Make sure it', '  is in your PATH or set the PKG_CONFIG environment variable to the full', '  path to pkg-config.', '  ', '  Alternatively, you may set the environment variables DBUS_CFLAGS', '  and DBUS_LIBS to avoid the need to call pkg-config.', '  See the pkg-config man page for more details.', '  ', '  To get pkg-config, see <http://pkg-config.freedesktop.org/>.', "  See `config.log' for more details", '  Traceback (most recent call last):', '    File "<string>", line 1, in <module>', '    File "/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py", line 109, in <module>', "      tests_require=['tap.py'],", '    File "/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup', '      return distutils.core.setup(**attrs)', '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup', '      dist.run_commands()', '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands', '      self.run_command(cmd)', '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command', '      cmd_obj.run()', '    File "/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages/wheel/bdist_wheel.py", line 192, in run', "      self.run_command('build')", '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command', '      self.distribution.run_command(command)', '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command', '      cmd_obj.run()', '    File "/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py", line 62, in run', '      cwd=builddir)', '    File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call', '      raise CalledProcessError(retcode, cmd)', "  subprocess.CalledProcessError: Command '['/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7', '--prefix=/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7/prefix']' returned non-zero exit status 1.", '  ----------------------------------------', '  ERROR: Failed building wheel for dbus-python', '    ERROR: Command errored out with exit status 1:', '     command: /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-record-szzh7kjz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/../include/site/python3.7/dbus-python', '         cwd: /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/', '    Complete output (156 lines):', '    running install', '    running build', '    creating /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build', '    creating /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7', '    checking whether make supports nested variables... yes', '    checking whether to enable maintainer-specific portions of Makefiles... no', '    checking for gcc... gcc', '    checking whether the C compiler works... yes', '    checking for C compiler default output file name... a.out', '    checking for suffix of executables...', '    checking whether we are cross compiling... no', '    checking for suffix of object files... o', '    checking whether we are using the GNU C compiler... yes', '    checking whether gcc accepts -g... yes', '    checking for gcc option to accept ISO C89... none needed', '    checking whether gcc understands -c and -o together... yes', '    checking how to run the C preprocessor... gcc -E', '    checking for grep that handles long lines and -e... /usr/bin/grep', '    checking for egrep... /usr/bin/grep -E', '    checking for ANSI C header files... yes', '    checking for sys/types.h... yes', '    checking for sys/stat.h... yes', '    checking for stdlib.h... yes', '    checking for string.h... yes', '    checking for memory.h... yes', '    checking for strings.h... yes', '    checking for inttypes.h... yes', '    checking for stdint.h... yes', '    checking for unistd.h... yes', '    checking minix/config.h usability... no', '    checking minix/config.h presence... no', '    checking for minix/config.h... no', '    checking whether it is safe to define __EXTENSIONS__... yes', '    checking for a BSD-compatible install... /usr/bin/install -c', '    checking whether build environment is sane... yes', '    checking for a thread-safe mkdir -p... /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build-aux/install-sh -c -d', '    checking for gawk... no', '    checking for mawk... no', '    checking for nawk... no', '    checking for awk... awk', '    checking whether make sets $(MAKE)... yes', '    checking for style of include used by make... GNU', "    checking whether UID '501' is supported by ustar format... yes", "    checking whether GID '20' is supported by ustar format... yes", '    checking how to create a ustar tar archive... gnutar', '    checking dependency style of gcc... gcc3', '    checking build system type... x86_64-apple-darwin18.7.0', '    checking host system type... x86_64-apple-darwin18.7.0', '    checking for native Windows host... no', '    checking how to print strings... printf', '    checking for a sed that does not truncate output... /usr/bin/sed', '    checking for fgrep... /usr/bin/grep -F', '    checking for ld used by gcc... /Library/Developer/CommandLineTools/usr/bin/ld', '    checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no', '    checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B', '    checking the name lister (/usr/bin/nm -B) interface... BSD nm', '    checking whether ln -s works... yes', '    checking the maximum length of command line arguments... 196608', '    checking how to convert x86_64-apple-darwin18.7.0 file names to x86_64-apple-darwin18.7.0 format... func_convert_file_noop', '    checking how to convert x86_64-apple-darwin18.7.0 file names to toolchain format... func_convert_file_noop', '    checking for /Library/Developer/CommandLineTools/usr/bin/ld option to reload object files... -r', '    checking for objdump... objdump', '    checking how to recognize dependent libraries... pass_all', '    checking for dlltool... no', '    checking how to associate runtime and link libraries... printf %s\\n', '    checking for ar... ar', '    checking for archiver @FILE support... no', '    checking for strip... strip', '    checking for ranlib... ranlib', '    checking command to parse /usr/bin/nm -B output from gcc object... ok', '    checking for sysroot... no', '    checking for a working dd... /bin/dd', '    checking how to truncate binary pipes... /bin/dd bs=4096 count=1', '    checking for mt... no', '    checking if : is a manifest tool... no', '    checking for dsymutil... dsymutil', '    checking for nmedit... nmedit', '    checking for lipo... lipo', '    checking for otool... otool', '    checking for otool64... no', '    checking for -single_module linker flag... yes', '    checking for -exported_symbols_list linker flag... yes', '    checking for -force_load linker flag... yes', '    checking for dlfcn.h... yes', '    checking for objdir... .libs', '    checking if gcc supports -fno-rtti -fno-exceptions... yes', '    checking for gcc option to produce PIC... -fno-common -DPIC', '    checking if gcc PIC flag -fno-common -DPIC works... yes', '    checking if gcc static flag -static works... no', '    checking if gcc supports -c -o file.o... yes', '    checking if gcc supports -c -o file.o... (cached) yes', '    checking whether the gcc linker (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes', '    checking dynamic linker characteristics... darwin18.7.0 dyld', '    checking how to hardcode library paths into programs... immediate', '    checking whether stripping libraries is possible... yes', '    checking if libtool supports shared libraries... yes', '    checking whether to build shared libraries... yes', '    checking whether to build static libraries... no', '    checking for inline... inline', '    checking for gawk... (cached) awk', '    checking for python... /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7', "    checking for a version of Python >= '2.1.0'... yes", "    checking for a version of Python >= '2.7'... yes", '    checking for the distutils Python package... yes', '    checking for Python include path... -I/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/include/python3.7m', '    checking for Python library path... -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib -lpython3.7m', '    checking for Python site-packages path... /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages', '    checking python extra libraries... -ldl  -framework CoreFoundation', '    checking python extra linking flags... -Wl,-stack_size,1000000  -framework CoreFoundation /usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/Python', '    checking consistency of all components of python development environment... yes', '    checking for python version... 3.7', '    checking for python platform... darwin', '    checking for python script directory... ${prefix}/lib/python3.7/site-packages', '    checking for python extension module directory... ${exec_prefix}/lib/python3.7/site-packages', '    checking for git... /usr/bin/git', '    checking python3.7 module: sphinx... no', '    checking python3.7 module: sphinx_rtd_theme... no', '    checking for dbus-run-session... /usr/local/bin/dbus-run-session', '    checking for pkg-config... no', '    checking for DBUS... no', "    configure: error: in `/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7':", '    configure: error: The pkg-config script could not be found or is too old.  Make sure it', '    is in your PATH or set the PKG_CONFIG environment variable to the full', '    path to pkg-config.', '    ', '    Alternatively, you may set the environment variables DBUS_CFLAGS', '    and DBUS_LIBS to avoid the need to call pkg-config.', '    See the pkg-config man page for more details.', '    ', '    To get pkg-config, see <http://pkg-config.freedesktop.org/>.', "    See `config.log' for more details", '    Traceback (most recent call last):', '      File "<string>", line 1, in <module>', '      File "/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py", line 109, in <module>', "        tests_require=['tap.py'],", '      File "/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup', '        return distutils.core.setup(**attrs)', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup', '        dist.run_commands()', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands', '        self.run_command(cmd)', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command', '        cmd_obj.run()', '      File "/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run', '        return orig.install.run(self)', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 545, in run', "        self.run_command('build')", '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/cmd.py", line 313, in run_command', '        self.distribution.run_command(command)', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command', '        cmd_obj.run()', '      File "/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py", line 62, in run', '        cwd=builddir)', '      File "/usr/local/Cellar/python/3.7.4/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 347, in check_call', '        raise CalledProcessError(retcode, cmd)', "    subprocess.CalledProcessError: Command '['/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7', '--prefix=/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/build/temp.macosx-10.14-x86_64-3.7/prefix']' returned non-zero exit status 1.", '    ----------------------------------------', 'ERROR: Command errored out with exit status 1: /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-install-lytky0yq/dbus-python/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' install --record /private/var/folders/1g/tc8g5htx4yl34ddgn66n0j8h0000gn/T/pip-record-szzh7kjz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/danny/.local/share/virtualenvs/trakt-scrobbler-master-8FDqjp3X/bin/../include/site/python3.7/dbus-python Check the logs for full command output.']```

Max limit for trying to add media to history

In cases when the media has been misidentified, and Trakt rejects our scrobbling request, the scrobbler will add the item to history periodically, and it will try to do so indefinitely. There should be an upper limit to the number of times it tries to add the media to history, after which it will simply be removed from the set. But it needs to be ensured that a legitimate cause (such as no network connection) doesn't exhaust this limit. A good way to check would be the status_code of the response.

[BUG] Setup device auth doesn't show any trakt code

Describe the bug
While running windows install bat, the trakt "activate your device" page comes up, but theres no code in the cmd window

Desktop (please complete the following information):

  • OS: windows
  • Python Version: 3.8
C:\WINDOWS\system32>"C:\Users\usernameDesktop\trakt-scrobbler-master\scripts\windows-install.bat"
Checking pipenv install.

Checking config file
config.toml already exists in "C:\Users\username\AppData\Roaming\trakt-scrobbler\".
Please ensure that it matches sample_config.toml, or the app may crash unexpectedly.

Installing to "C:\Users\username\AppData\Local\trakt-scrobbler"
File not found - trakt_scrobbler
File not found - Pipfile
File not found - Pipfile.lock
Installing dependencies from Pipfile.lock (dc303a)…
Ignoring dbus-python: markers 'sys_platform == "linux"' don't match your environment
Ignoring notify2: markers 'sys_platform != "win32"' don't match your environment
  ================================ 16/16 - 00:00:02
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
Setup complete. Starting device authentication.

Need to manually run the script on each playback

Every time I start playback in some player, it scrobbles only after running the command "pipenv run python main.py". It is not scrobbling manually. Windows 10 x64. And movies are not being marked as watched after completion of playback. Am I doing something wrong? Please help.

[BUG] Stops working after not in use for some time

Describe the bug
If nothing in the whitelist folder is played for a ~day, the next day pythonw.exe will still be running but the script is dead.

OS: Windows 7

Log file

Click to see log contents

2019-06-14 12:31:03,614 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-06-14 12:31:03,614 - WARNING - MainThread - utils - data\watched_cache.json doesn't exist.
2019-06-14 12:31:03,616 - INFO - MainThread - monitor - Started monitor for mpchc
2019-06-14 12:31:04,624 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-06-14 23:18:04,650 - DEBUG - mpchc - file_info - Filepath F:\Present\JoJo's Bizarre Adventure - Golden Wind\[HorribleSubs] JoJo's Bizarre Adventure - Golden Wind - 34 [1080p].mkv
2019-06-14 23:18:04,651 - INFO - mpchc - file_info - File path not in whitelist.
2019-06-14 23:58:06,163 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-06-15 02:18:22,254 - DEBUG - mpchc - file_info - Filepath F:\Present\One Punch Man S2\[HorribleSubs] One Punch Man S2 - 09 [1080p].mkv
2019-06-15 02:18:22,255 - INFO - mpchc - file_info - File path not in whitelist.
2019-06-15 02:42:23,948 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-06-15 02:45:19,038 - DEBUG - mpchc - file_info - Filepath F:\Present\Carole & Tuesday\[PAS] Carole & Tuesday - 10 (WEB 720p AAC) [00D69AF8].mkv
2019-06-15 02:45:19,039 - INFO - mpchc - file_info - File path not in whitelist.
2019-06-15 03:07:00,664 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-06-15 03:12:07,775 - ERROR - mpchc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\Fernando\AppData\Local\trakt-scrobbler\main.py", line 60, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\Fernando\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 80, in run
    self.update_status()
  File "C:\Users\Fernando\AppData\Local\trakt-scrobbler\player_monitors\mpc.py", line 29, in update_status
    if variables['duration'] == '0':
KeyError: 'duration'

Install.py requires poetry (Windows 10)

Hi @iamkroot,

After running python install.py I get the following log in the console:

image

I installed poetry using the get-poetry.py script, I check if the environment Path is updated and then I restart the console and try again but I get the same result.

User environment variables:

image

System environment variables:

image

From other issues I saw that you recommend doing some diagnostics, so here is the result of that:

image

Also I noticed that I do not have a log file after running the install.py script so I can not paste it here.

System info:

  • OS: Windows 10 Pro 1809 (build 17763.914)
  • Python Version: 3.8.1

Any help would be appreciated!

[Feature Request] Plex integration.

Info:

Plex Media Server is a DIY Netflix like. supports multiple devices and players.

Current situation:

Plex-Trakt-Scrobbler is unmaintained, currently broken and eventually Plex will stop supporting plugins (Plugins are being retired)

Plex Webhooks are available for Plex Pass only, many users don't have, most don't need it.
Paying a for only one feature isn't not a good investment.

Solution:

Third party apps can communicate with Plex via API (python-plexapi), collect statistics, show playing stream etc...

Examples:
Tautulli
plexWatch

trakt-scrobbler will be a nice addition for many users that use Plex and Trakt

ImportError: DLL load failed while importing win32api: The specified module could not be found.

Hello @iamkroot!

Thank you for this scrobbler!

I got stuck installing it tho. If you have the time, can you help me out?

(Windows 10 64bit)

C:\Users\username>"C:\Users\username\Desktop\trakt-scrobbler-master\scripts\windows-install.bat"
Checking pipenv install.

Checking config file
config.toml already exists in "C:\Users\username\AppData\Roaming\trakt-scrobbler\".
Please ensure that it matches sample_config.toml, or the app may crash unexpectedly.

Installing to "C:\Users\username\AppData\Local\trakt-scrobbler"
File not found - trakt_scrobbler
File not found - Pipfile
File not found - Pipfile.lock
Installing dependencies from Pipfile.lock (dc303a)…
Ignoring dbus-python: markers 'sys_platform == "linux"' don't match your environment
Ignoring notify2: markers 'sys_platform != "win32"' don't match your environment
  ================================ 16/16 - 00:00:02
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
All dependencies are now up-to-date!
Setup complete. Starting device authentication.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\username\AppData\Local\trakt-scrobbler\trakt_interface.py", line 7, in <module>
    from notifier import notify
  File "C:\Users\username\AppData\Local\trakt-scrobbler\notifier.py", line 8, in <module>
    from win10toast import ToastNotifier
  File "C:\Users\username\.virtualenvs\trakt-scrobbler-DTMn-yQC\lib\site-packages\win10toast\__init__.py", line 19, in <module>
    from win32api import GetModuleHandle
ImportError: DLL load failed while importing win32api: The specified module could not be found.
"You can run this script again once the issue is fixed. Quitting.

Thank you!

[BUG] Scrobbler only runs manually and doesn't kill itself when the player is closed

The scrobbler won't quit after closing the player. Also, it won't relaunch when opening a new file. It will only output when manually running trakt-scrobbler.bat, but the previous instances will still be running.

Desktop:

  • OS: Windows 10 1809
  • Python Version: 3.7.4
  • Player: MPC-HC
  • Player Version: 1.8.8

To Reproduce
Steps to reproduce the behavior:
1.Open a file
2.Check the log to confirm there is an output for said file
3.Close MPC-HC
4.Open another file or the same one
5.Check the log: there's no output
6.Close MPC-HC
7.Run trakt-scrobbler.bat
8.Open a file
9.Check the log to confirm there is an output for said file
10.Open taskmanager and confirm that there are multiple versions of pythonw.exe

Log file

Click to see log contents

2019-10-10 03:41:43,814 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 03:41:43,815 - DEBUG - MainThread - utils - C:\Users\Fabio\AppData\Roaming\trakt-scrobbler\watched_cache.json doesn't exist.
2019-10-10 03:41:43,822 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 03:41:43,841 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 03:41:43,841 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 03:42:06,846 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E03 - Office Olympics\The Office (US).S02E03.Office Olympics.mp4
2019-10-10 03:42:06,846 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 03:42:06,847 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 03:57:32,382 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 03:58:21,783 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 03:58:21,785 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 03:58:21,791 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 03:58:21,792 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 03:58:23,796 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 03:58:45,809 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E03 - Office Olympics\The Office (US).S02E03.Office Olympics.mp4
2019-10-10 03:58:45,809 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 03:58:45,809 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 03:59:08,821 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:06,001 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 04:03:06,004 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 04:03:06,010 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 04:03:06,011 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 04:03:14,854 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:14,855 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:14,855 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:18,022 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:18,022 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:18,023 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:19,962 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:19,963 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:19,963 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:26,861 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:30,028 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:31,969 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.

Config file

Click to see contents


[general]
enable_notifs = true

[fileinfo]
whitelist = []

# example regexes. To test your custom regexes, try regex101.com
[fileinfo.include_regexes]  # custom regex to identify media information, should be posix path. Use single quotes for the strings.
movie = [
	'.*/(?P<name>.+?) \((?P<year>[0-9]{4})\).*',  # matches /a/b/Taxi Driver (1976).mkv
]
episode = [
	'.*/(?P<title>.+?) \[[0-9]{3,4}p\]/(?P<episode>\d+) - (?P<episode_title>.*)\.[a-z]{3,4}',  # matches "/a/b/One Punch Man [1080p]/01 - Return of the Hero.mkv"
	'.*/(?P<title>.+?)\s*?(\[[0-9]{3,4}p\])?/(S|Season)\s?(?P<season>\d+)/(?P<episode>\d+).*',  # matches "/a/b/Mob Psycho 100/Season 2/01 - Ripped Apart ~Someone Is Watching~.mkv"
]

[players]
monitored = ['mpchc', 'mpv']  # players to be monitored. Allowed: 'mpcbe', 'mpchc', 'mpv', 'vlc'
skip_interval = 5  # min percent jump to consider for scrobbling to trakt

[players.mpcbe]  # enable web interface from options
ip = "localhost"
port = "13579"  # from Options -> Player -> Web Interface -> Listen on port  (ensure it is ticked) 
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpchc]  # enable web interface from options
ip = "localhost"
port = "13579"  # if both mpchc and mpcbe are to be monitored, then ensure that their ports are different
poll_interval = 10  # in seconds

[players.vlc]  # enable web interface from options
ip = "localhost"
port = "8080"  # from Preferences -> All -> Input/Codecs -> HTTP Server Port
password = "password"  # from Preferences -> All -> Interface -> Main Interfaces -> Lua -> Lua HTTP Password
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpv]  # enable the JSON IPC server. Either via cmd line arg (eg: --input-ipc-server=\\.\pipe\mpvpipe), or in mpv.conf file
ipc_path = '\\.\pipe\mpvpipe'  # windows (single quotes are important)
# ipc_path = "/tmp/mpvsocket"  # unix


[BUG] macOS installation fails on main.py step

Describe the bug
The macOS installation steps fail on the pipenv run python main.py step (which should be pipenv run python scripts/main.py, and is missing a step cp config.toml ~/Library/Preferences/trakt-scrobbler/config.toml):

❯ pipenv run python trakt_scrobbler/main.py
dbus[1044]: Dynamic session lookup supported but failed: launchd did not provide a socket path, verify that org.freedesktop.dbus-session.plist is loaded!
Traceback (most recent call last):
  File "trakt_scrobbler/main.py", line 12, in <module>
    from scrobbler import Scrobbler
  File "/Users/kevinji/Documents/GitHub/trakt-scrobbler/trakt_scrobbler/scrobbler.py", line 3, in <module>
    from notifier import notify
  File "/Users/kevinji/Documents/GitHub/trakt-scrobbler/trakt_scrobbler/notifier.py", line 8, in <module>
    notify2.init(APP_NAME)
  File "/Users/kevinji/.local/share/virtualenvs/trakt-scrobbler-WfXl7Y8L/lib/python3.7/site-packages/notify2.py", line 100, in init
    bus = dbus.SessionBus(mainloop=mainloop)
  File "/Users/kevinji/.local/share/virtualenvs/trakt-scrobbler-WfXl7Y8L/lib/python3.7/site-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/Users/kevinji/.local/share/virtualenvs/trakt-scrobbler-WfXl7Y8L/lib/python3.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/Users/kevinji/.local/share/virtualenvs/trakt-scrobbler-WfXl7Y8L/lib/python3.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoMemory: Not enough memory

Desktop (please complete the following information):

  • OS: macOS
  • Python Version: 3.7.4
  • Player: N/A
  • Player Version: N/A

To Reproduce
Follow the macOS steps to the pipenv run python main.py step. I've installed dbus with Homebrew and also ran brew services start dbus, and rebooted my machine.

Log file
N/A

Not working with mpv on windows 10

Not able to get it working with mpv though. I think it is a problem with input-ipc-server but I maybe wrong. This is what I typed into the mpv config file "input-ipc-server=\\.\pipe\mpvpipe" Am I doing anything wrong? Please help.

installation problem - raspbian

When I run install.py I'm only getting this error:

  File "install.py", line 12
    def print_quit(*msg, status=1):
                              ^
SyntaxError: invalid syntax

And I don't think that this is the only error due to other outputs in the Python interface...
My Python version is 3.7

[BUG] Unable to load config.toml!

Describe the bug
I followed the instructions https://www.thenerdystudent.com/2019/06/trakt-scrobbler/
I got the same error over and over.

Desktop (please complete the following information):

  • OS: [Windows 10 x64]
  • Player VLC
  • Player Version [3.0.7.1]

PS H:\trakt-scrobbler> scripts\windows-install.bat
Installing to "C:\Users\bram\AppData\Local\trakt-scrobbler"
Installing dependencies from Pipfile.lock (b0e854)…
Ignoring dbus-python: markers 'sys_platform != "win32"' don't match your environment
Ignoring notify2: markers 'sys_platform != "win32"' don't match your environment
================================ 16/16 - 00:00:13
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.
Adding to startup commands.
Setup complete. Starting device authentication.
Unable to load config.toml!
Done.

what's the problem?
and how do I start over? (because it worked at once before)

[BUG] Issue on installing on new Windows OS

Describe the bug
Trying to install on a new PC, and getting this issue:

scripts\windows-install.bat
Checking config file
config.toml already exists in "C:\Users\giaco\AppData\Roaming\trakt-scrobbler\".
Please ensure that it matches sample_config.toml, or the app may crash unexpectedly.
ECHO is off.
Installing to "C:\Users\giaco\AppData\Local\trakt-scrobbler"
[pipenv.exceptions.LockfileNotFound]:   File "d:\python\lib\site-packages\pipenv\vendor\click\decorators.py", line 64, in new_func
[pipenv.exceptions.LockfileNotFound]:       return ctx.invoke(f, obj, *args, **kwargs)
[pipenv.exceptions.LockfileNotFound]:   File "d:\python\lib\site-packages\pipenv\vendor\click\core.py", line 555, in invoke
[pipenv.exceptions.LockfileNotFound]:       return callback(*args, **kwargs)
[pipenv.exceptions.LockfileNotFound]:   File "d:\python\lib\site-packages\pipenv\vendor\click\decorators.py", line 17, in new_func
[pipenv.exceptions.LockfileNotFound]:       return f(get_current_context(), *args, **kwargs)
[pipenv.exceptions.LockfileNotFound]:   File "d:\python\lib\site-packages\pipenv\cli\command.py", line 615, in sync
[pipenv.exceptions.LockfileNotFound]:       pypi_mirror=state.pypi_mirror,
[pipenv.exceptions.LockfileNotFound]:   File "d:\python\lib\site-packages\pipenv\core.py", line 2589, in do_sync
[pipenv.exceptions.LockfileNotFound]:       raise exceptions.LockfileNotFound("Pipfile.lock")
ERROR: Pipfile.lock not found! You need to run $ pipenv lock before you can continue.
 "Error while creating venv"

I have the exact repo in my downloads. How can I get it installed?

Thanks!

[BUG] Scobbling doesn't complete with VLC if paused instead of stopped

Describe the bug
When I watch a video with VLC, I expect trakt-scrobbler to recognise scrobbling has completed when I pause the video after it is a certain percentage of the way through (for example during the end-credits), but instead trakt-scrobbler does not recognise scrobble complete, and requires the video to be stopped.

Specifics:

  • Test video length: 42:59
  • 18:27:23 Video pre-loaded into player
  • 18:27:44 Video paused - queued to watch later
  • 21:36:48 Video unpaused - started watching
  • 21:19:28 Video paused - end credits - finished watching - expect scrobble complete
  • 22:40:47 Video unpaused - noticed scrobbling did not complete
  • 22:40:57 Video auto-stopped (reached end) - scrobbling marked as complete

Desktop (please complete the following information):

  • OS: Windows 10
  • Player VLC
  • Player Version 3.0.7.1

To Reproduce
Steps to reproduce the behavior:

  1. Open a video
  2. Play till the end credits
  3. Pause it
  4. Notice scrobbling not marked complete

Log file

Click to see log contents

2019-07-08 18:27:23,749 - DEBUG - vlc - file_info - Filepath /M:/Episodes/_Unsorted//**********..mkv
2019-07-08 18:27:23,756 - DEBUG - vlc - file_info - Trying to match custom regex.
2019-07-08 18:27:23,758 - DEBUG - vlc - file_info - No regex matches for /M:/Episodes/_Unsorted/**********.mkv
2019-07-08 18:27:23,759 - DEBUG - vlc - file_info - Using guessit module to match.
2019-07-08 18:27:23,993 - DEBUG - vlc - file_info - MatchesDict([('title', '**********'), ('season', 6), ('episode', 18), ('screen_size', '720p'), ('source', 'Web'), ('video_codec', 'H.264'), ('release_group', '**********'), ('container', 'mkv'), ('type', 'episode')])
2019-07-08 18:27:23,995 - DEBUG - scrobbler - trakt_interface - Searching cache.
2019-07-08 18:27:23,996 - DEBUG - scrobbler - trakt_interface - Searching trakt.
2019-07-08 18:27:25,219 - DEBUG - scrobbler - trakt_interface - Trakt ID: **********
2019-07-08 18:27:25,247 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 18:27:25,865 - INFO - scrobbler - scrobbler - Scrobble start successful.
2019-07-08 18:27:44,139 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 18:27:44,671 - INFO - scrobbler - scrobbler - Scrobble pause successful.
2019-07-08 21:36:48,498 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 21:36:49,155 - INFO - scrobbler - scrobbler - Scrobble start successful.
2019-07-08 22:19:27,886 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 22:19:28,435 - INFO - scrobbler - scrobbler - Scrobble pause successful.
2019-07-08 22:40:47,305 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 22:40:47,876 - INFO - scrobbler - scrobbler - Scrobble start successful.
2019-07-08 22:40:57,356 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': **********}}, 'episode': {'season': 6, 'number': 18}}
2019-07-08 22:40:57,985 - INFO - scrobbler - scrobbler - Scrobble stop successful.

[BUG] Filename is not being parsed even though guessit can parse it on cmd

Describe the bug
It seems to be failing to use guessit. Since I didn't enable any custom regex, I just get an error on the log.
While trying to find if the error was caused by my naming convention, I installed guessit and tried to parse it on cmd with success.

Desktop (please complete the following information):

  • OS: Windows 10 1809
  • Python Version: 3.7.4
  • Player: MPC-HC
  • Player Version: 1.8.8

To Reproduce
1.Run any file and check the log to see if it was parsed.
2.Install guessit using pip install guessit
3.Run guessit "FILENAME" on cmd

Log file

Click to see log contents


2019-10-10 03:41:43,814 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 03:41:43,815 - DEBUG - MainThread - utils - C:\Users\Fabio\AppData\Roaming\trakt-scrobbler\watched_cache.json doesn't exist.
2019-10-10 03:41:43,822 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 03:41:43,841 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 03:41:43,841 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 03:42:06,846 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E03 - Office Olympics\The Office (US).S02E03.Office Olympics.mp4
2019-10-10 03:42:06,846 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 03:42:06,847 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 03:57:32,382 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 03:58:21,783 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 03:58:21,785 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 03:58:21,791 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 03:58:21,792 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 03:58:23,796 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 03:58:45,809 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E03 - Office Olympics\The Office (US).S02E03.Office Olympics.mp4
2019-10-10 03:58:45,809 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 03:58:45,809 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 03:59:08,821 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:06,001 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 04:03:06,004 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 04:03:06,010 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 04:03:06,011 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 04:03:14,854 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:14,855 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:14,855 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:18,022 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:18,022 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:18,023 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:19,962 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\The Office (US) (2005)\Season 02\The Office (US) - S02E02 - Sexual Harassment\The Office (US).S02E02.Sexual Harassment.mp4
2019-10-10 04:03:19,963 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:03:19,963 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:03:26,861 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:30,028 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:03:31,969 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:13:37,263 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-10-10 04:13:37,266 - INFO - MainThread - monitor - Started monitor for mpchc
2019-10-10 04:13:37,272 - INFO - MainThread - monitor - Started monitor for mpv
2019-10-10 04:13:37,273 - INFO - mpv - mpv - Unable to connect to MPV. Check ipc path.
2019-10-10 04:13:39,277 - INFO - mpchc - monitor - Unable to connect to mpchc. Ensure that the web interface is running.
2019-10-10 04:14:02,150 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\Family Guy (1999)\Season 13\Family Guy - S13E01 - The Simpsons Guy\Family Guy.S13E01.The Simpsons Guy.mkv
2019-10-10 04:14:02,151 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:14:02,151 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:14:02,291 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\Family Guy (1999)\Season 13\Family Guy - S13E01 - The Simpsons Guy\Family Guy.S13E01.The Simpsons Guy.mkv
2019-10-10 04:14:02,291 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:14:02,292 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:14:05,327 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\Family Guy (1999)\Season 13\Family Guy - S13E01 - The Simpsons Guy\Family Guy.S13E01.The Simpsons Guy.mkv
2019-10-10 04:14:05,328 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:14:05,328 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.
2019-10-10 04:14:07,266 - DEBUG - mpchc - file_info - Filepath C:\Users\Fabio\Videos\Séries\Family Guy (1999)\Season 13\Family Guy - S13E01 - The Simpsons Guy\Family Guy.S13E01.The Simpsons Guy.mkv
2019-10-10 04:14:07,266 - DEBUG - mpchc - file_info - Trying to match custom regex.
2019-10-10 04:14:07,266 - WARNING - mpchc - file_info - Failed to parse filename for episode/movie info. Consider renaming/using custom regex.

Config file

Click to see contents


[general]
enable_notifs = true

[fileinfo]
whitelist = []

# example regexes. To test your custom regexes, try regex101.com
[fileinfo.include_regexes]  # custom regex to identify media information, should be posix path. Use single quotes for the strings.
movie = [
	'.*/(?P<name>.+?) \((?P<year>[0-9]{4})\).*',  # matches /a/b/Taxi Driver (1976).mkv
]
episode = [
	'.*/(?P<title>.+?) \[[0-9]{3,4}p\]/(?P<episode>\d+) - (?P<episode_title>.*)\.[a-z]{3,4}',  # matches "/a/b/One Punch Man [1080p]/01 - Return of the Hero.mkv"
	'.*/(?P<title>.+?)\s*?(\[[0-9]{3,4}p\])?/(S|Season)\s?(?P<season>\d+)/(?P<episode>\d+).*',  # matches "/a/b/Mob Psycho 100/Season 2/01 - Ripped Apart ~Someone Is Watching~.mkv"
]

[players]
monitored = ['mpchc', 'mpv']  # players to be monitored. Allowed: 'mpcbe', 'mpchc', 'mpv', 'vlc'
skip_interval = 5  # min percent jump to consider for scrobbling to trakt

[players.mpcbe]  # enable web interface from options
ip = "localhost"
port = "13579"  # from Options -> Player -> Web Interface -> Listen on port  (ensure it is ticked) 
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpchc]  # enable web interface from options
ip = "localhost"
port = "13579"  # if both mpchc and mpcbe are to be monitored, then ensure that their ports are different
poll_interval = 10  # in seconds

[players.vlc]  # enable web interface from options
ip = "localhost"
port = "8080"  # from Preferences -> All -> Input/Codecs -> HTTP Server Port
password = "password"  # from Preferences -> All -> Interface -> Main Interfaces -> Lua -> Lua HTTP Password
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

[players.mpv]  # enable the JSON IPC server. Either via cmd line arg (eg: --input-ipc-server=\\.\pipe\mpvpipe), or in mpv.conf file
ipc_path = '\\.\pipe\mpvpipe'  # windows (single quotes are important)
# ipc_path = "/tmp/mpvsocket"  # unix


Output from guessit on cmd

Click to see contents

C:\Users\Fabio>guessit "The Office (US).S02E03.Office Olympics.mp4"
For: The Office (US).S02E03.Office Olympics.mp4
GuessIt found: {
    "title": "The Office",
    "country": "UNITED STATES",
    "season": 2,
    "episode": 3,
    "episode_title": "Office Olympics",
    "container": "mp4",
    "mimetype": "video/mp4",
    "type": "episode"
}

C:\Users\Fabio>guessit "The Office (US).S02E02.Sexual Harassment.mp4"
For: The Office (US).S02E02.Sexual Harassment.mp4
GuessIt found: {
    "title": "The Office",
    "country": "UNITED STATES",
    "season": 2,
    "episode": 2,
    "episode_title": "Sexual Harassment",
    "container": "mp4",
    "mimetype": "video/mp4",
    "type": "episode"
}

C:\Users\Fabio>guessit "Family Guy.S13E01.The Simpsons Guy.mkv"
For: Family Guy.S13E01.The Simpsons Guy.mkv
GuessIt found: {
    "title": "Family Guy",
    "season": 13,
    "episode": 1,
    "episode_title": "The Simpsons Guy",
    "container": "mkv",
    "mimetype": "video/x-matroska",
    "type": "episode"
}

Problem with user name separated by space?

Desktop

  • OS: Windows 10
  • Player MPC-HC Fork
  • Player Version 1.8.6

To Reproduce

  • Create a user account and name it " NameA NameB" separated by a space
  • Start the windows install batch file

Logs
Setup complete. Starting device authentication.
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'trakt_interface'
'C:\Users\Mohamed' is not recognized as an internal or external command,
operable program or batch file.
Done.

Update Trakt with skips

Hi there

I usually skip intros - was wondering if it was possible to ping Trakt to keep the time stamp up to date?

Thanks!

[HELP WANTED] Unable to install on Mac Catalina

Describe the bug
I cannot install on my Mac. Please help. Thank you.

Prabas-MacBook-Air:tools codechilli$ python3 install.py Starting installation for trakt-scrobbler Traceback (most recent call last): File "install.py", line 225, in <module> main() File "install.py", line 204, in main source_dir, install_dir, cfg_dir = get_default_paths() File "install.py", line 40, in get_default_paths install_dir.mkdir(exist_ok=True, parents=True) AttributeError: 'tuple' object has no attribute 'mkdir' Prabas-MacBook-Air:tools codechilli$

image

Desktop:

  • OS: MacOS Catalina
  • Python Version: 3.8.1
  • Player :VLC, MPV,PLEX
  • Player Version: VLC 3.0.6 Vetinari

[BUG] crashes scrobbler on w10

after this happens scrobbler dont work any more! ;(

yeah i just censored out driver location :P

A clear and concise description of what the bug/error is.

Desktop (please complete the following information):

  • OS: w 10
  • Python Version: 373
  • Player VLC
  • Player Version 3.0.8

Log file

Click to see log contents

2020-03-07 09:30:22,991 - DEBUG - vlc - file_info - Filepath '1337:/TEst/SCORPION (2014-2018) - Complete TV Series, Season 1,2,3,4 S01,S02,S03,S04 - 720p Web-DL x264/Season 3 (2016-17)/SCORPION - S03 E09 - Mother Load (720p - Web-DL).mp4'
2020-03-07 09:30:22,992 - DEBUG - vlc - file_info - Trying to match custom regex.
2020-03-07 09:30:22,992 - DEBUG - vlc - file_info - No regex matches for 1337:/Test/SCORPION (2014-2018) - Complete TV Series, Season 1,2,3,4 S01,S02,S03,S04 - 720p Web-DL x264/Season 3 (2016-17)/SCORPION - S03 E09 - Mother Load (720p - Web-DL).mp4
2020-03-07 09:30:22,992 - DEBUG - vlc - file_info - Using guessit module to match.
2020-03-07 09:30:23,066 - DEBUG - vlc - file_info - MatchesDict([('title', 'SCORPION'), ('year', [2014, 2018]), ('other', 'Complete'), ('release_group', 'TV Series'), ('season', [1, 2, 3, 4]), ('screen_size', '720p'), ('source', 'Web'), ('video_codec', 'H.264'), ('episode', 9), ('container', 'mp4'), ('mimetype', 'video/mp4'), ('type', 'episode')])
2020-03-07 09:30:23,066 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\Test\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 140, in run
    self.handle_status_update()
  File "C:\Users\Test\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 114, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\coldasice\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 71, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\coldasice\AppData\Local\trakt-scrobbler\file_info.py", line 63, in get_media_info
    guess['season'] = int(guess.get('season', 1))
TypeError: int() argument must be a string, a bytes-like object or a number, not 'list'

[BUG] doesnt work

Describe the bug
Watched shows doesn't pass to trakt

Desktop (please complete the following information):

  • OS: Windows 10
  • Python Version: [e.g. 3.7.3] 3.8.2
  • Player [e.g. VLC, MPV] MPC-HC 64
  • Player Version [e.g. 1.3.2] 1.9

Log file

Click to see log contents 2020-03-05 01:41:27,438 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 01:41:27,438 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_token.json doesn't exist. 2020-03-05 01:41:27,438 - INFO - MainThread - trakt_interface - Access token not found in config. Initiating device authentication. 2020-03-05 01:41:27,758 - INFO - MainThread - trakt_interface - Verification URL: https://trakt.tv/activate 2020-03-05 01:41:27,758 - INFO - MainThread - trakt_interface - User Code: D9251C4C 2020-03-05 01:41:28,147 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:41:33,421 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:41:38,715 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:41:44,468 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:41:49,738 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:41:55,013 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:00,307 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:05,582 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:10,870 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:16,148 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:21,957 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:27,288 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:32,561 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:37,839 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:43,124 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:48,389 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:53,685 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:42:58,954 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:04,241 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:09,516 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:14,786 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:20,101 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:25,375 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:30,665 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:35,951 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:41,224 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:46,513 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:51,787 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:43:57,077 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:44:02,358 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:44:07,619 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:44:12,906 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app. 2020-03-05 01:44:18,230 - INFO - MainThread - trakt_interface - Device auth successful. 2020-03-05 01:48:11,185 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 01:48:11,191 - INFO - MainThread - scrobbler - Started scrobbler thread. 2020-03-05 01:48:11,191 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\watched_cache.json doesn't exist. 2020-03-05 01:48:11,204 - ERROR - MainThread - monitor - Config value autoload failed for mpc-hc. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpc.py", line 25, in read_player_cfg hkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey) FileNotFoundError: [WinError 2] Не удается найти указанный файл 2020-03-05 01:48:11,253 - ERROR - MainThread - monitor - Config value autoload failed for mpv. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpv.py", line 50, in read_player_cfg mpv_conf.read_string("[root]\n" + conf_path.read_text()) File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1227, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1213, in open return io.open(self, mode, buffering, encoding, errors, newline, File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1069, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\elreg\\AppData\\Roaming\\mpv\\mpv.conf' 2020-03-05 02:04:35,849 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 02:04:35,854 - INFO - MainThread - scrobbler - Started scrobbler thread. 2020-03-05 02:04:35,862 - ERROR - MainThread - monitor - Config value autoload failed for mpc-hc. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpc.py", line 25, in read_player_cfg hkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey) FileNotFoundError: [WinError 2] Не удается найти указанный файл 2020-03-05 02:04:35,910 - ERROR - MainThread - monitor - Config value autoload failed for mpv. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpv.py", line 50, in read_player_cfg mpv_conf.read_string("[root]\n" + conf_path.read_text()) File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1227, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1213, in open return io.open(self, mode, buffering, encoding, errors, newline, File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1069, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\elreg\\AppData\\Roaming\\mpv\\mpv.conf' 2020-03-05 02:28:44,500 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 02:28:44,501 - INFO - MainThread - scrobbler - Started scrobbler thread. 2020-03-05 02:28:44,503 - ERROR - MainThread - monitor - Config value autoload failed for mpc-hc. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpc.py", line 25, in read_player_cfg hkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey) FileNotFoundError: [WinError 2] Не удается найти указанный файл 2020-03-05 02:28:44,510 - ERROR - MainThread - monitor - Config value autoload failed for mpv. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpv.py", line 50, in read_player_cfg mpv_conf.read_string("[root]\n" + conf_path.read_text()) File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1227, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1213, in open return io.open(self, mode, buffering, encoding, errors, newline, File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1069, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\elreg\\AppData\\Roaming\\mpv\\mpv.conf' 2020-03-05 02:36:02,931 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 02:37:41,632 - DEBUG - MainThread - utils - C:\Users\elreg\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist. 2020-03-05 02:37:41,635 - INFO - MainThread - scrobbler - Started scrobbler thread. 2020-03-05 02:37:41,645 - ERROR - MainThread - monitor - Config value autoload failed for mpc-hc. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpc.py", line 25, in read_player_cfg hkey = winreg.OpenKey(winreg.HKEY_CURRENT_USER, subkey) FileNotFoundError: [WinError 2] Не удается найти указанный файл 2020-03-05 02:37:41,670 - ERROR - MainThread - monitor - Config value autoload failed for mpv. Traceback (most recent call last): File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__ cls.config = cls.autoload_cfg() File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg loaders = getattr(cls, "read_player_cfg")(auto_keys) File "C:\Users\elreg\AppData\Local\trakt-scrobbler\player_monitors\mpv.py", line 50, in read_player_cfg mpv_conf.read_string("[root]\n" + conf_path.read_text()) File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1227, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1213, in open return io.open(self, mode, buffering, encoding, errors, newline, File "C:\Users\elreg\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1069, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\elreg\\AppData\\Roaming\\mpv\\mpv.conf' [trakt_scrobbler.log](https://github.com/iamkroot/trakt-scrobbler/files/4290255/trakt_scrobbler.log)

*PASTE LOG FILE CONTENTS HERE* (Remove everything between the "```")
Location: "trakt_scrobbler.log" file in the following folder, as per your OS 
Linux: ~/.local/share/trakt-scrobbler
Mac: ~/Library/Application Support/trakt-scrobbler
Windows: %APPDATA%\trakt-scrobbler (paste this in Run Dialog, Win+R)

Installation help

Describe the bug
Doesn't scrobble

Desktop (please complete the following information):

  • OS: Windows 10
  • Player: VLC
  • Player Version: 3.0.7.1

To Reproduce
Steps to reproduce the behavior:

  1. Open 'Supernatural.S14E04' file
  2. Play till '10 minutes'
  3. Close player/pause it
  4. No errors

Log file

Click to see log contents


2019-07-17 01:52:50,649 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-07-17 01:52:50,650 - DEBUG - MainThread - utils - C:\Users\spelworm\AppData\Roaming\trakt-scrobbler\watched_cache.json doesn't exist.
2019-07-17 02:05:42,316 - INFO - MainThread - scrobbler - Started scrobbler thread.

Probably doing something wrong but its not working for me, is this the right place to ask for help?

[BUG] Unable to load config.toml

Trying to run the install but it keeps erroring with unable to launch config.toml.

I'm sure I'm doing something wrong but my toml fine is fine according to the online parser.

Running Windows 10, Python 3.8 64bit.

Anyone help please?

Thanks,

[general]
enable_notifs = true

[fileinfo]
whitelist = []

# example regexes. To test your custom regexes, try regex101.com
[fileinfo.include_regexes]  # custom regex to identify media information, should be posix path. Use single quotes for the strings.
movie = [
	'.*/(?P<name>.+?) \((?P<year>[0-9]{4})\).*',  # matches /a/b/Taxi Driver (1976).mkv
]
episode = [
	'.*/(?P<title>.+?) \[[0-9]{3,4}p\]/(?P<episode>\d+) - (?P<episode_title>.*)\.[a-z]{3,4}',  # matches "/a/b/One Punch Man [1080p]/01 - Return of the Hero.mkv"
	'.*/(?P<title>.+?)\s*?(\[[0-9]{3,4}p\])?/(S|Season)\s?(?P<season>\d+)/(?P<episode>\d+).*',  # matches "/a/b/Mob Psycho 100/Season 2/01 - Ripped Apart ~Someone Is Watching~.mkv"
]

[players]
monitored = ['mpcbe']  # players to be monitored. Allowed: 'mpcbe', 'mpchc', 'mpv', 'vlc'
skip_interval = 5  # min percent jump to consider for scrobbling to trakt

[players.mpcbe]  # enable web interface from options
ip = "localhost"
port = "13579"  # from Options -> Player -> Web Interface -> Listen on port  (ensure it is ticked) 
poll_interval = 10  # in seconds. How frequently the monitor should check for player update.

Poetry could not find a pyproject.toml

Hi @iamkroot

Still at trying to install the scrobbler on ubuntu 18.04

Im really stuck with Poetry could not find a pyproject.toml file

LOG:

user@user-P31-DS3L:~$ /home/user/trakt-scrobbler-master/scripts/linux-install-service.sh
Checking poetry install.

Checking config file
config.toml already exists in /home/user/.config/trakt-scrobbler/.
Please ensure that it matches sample_config.toml, or the app may crash unexpectedly.

Installing to /home/user/.local/trakt-scrobbler/
cp: cannot stat 'trakt_scrobbler/**': No such file or directory
cp: cannot stat './pyproject.toml': No such file or directory
cp: cannot stat './poetry.lock': No such file or directory

[RuntimeError]
Poetry could not find a pyproject.toml file in /home/user/.local/trakt-scrobbler or its parents

Any idea?

Naming convention to enable tracking?

Works great on shows such as Breaking Bad that I have downloaded.

I am trying to work it with this show: https://trakt.tv/shows/boys-over-flowers-1996

Currently the files are named like so:

image

How should I rename them to enable the scrobbler to work?

PS: Thanks for making and maintaining a VLC scrobbler. Been searching for a replacement for the 'official' one, and this works great!

[Question] about monitor connecting to a player

Hello again @iamkroot,

After the previous issue #44 I got to the point where I get this in the log file:

image

As I understand the vlc player monitor has started successfully.
However it does not connect to the VLC web interface.

I double checked whether the port and the password are set correctly everywhere and they are.
The web interface is working BUT it is only working when the VLC player is running.

I guess my question is whether when I start VLC player to watch something is the monitor going to connect to the player and scrobble what I watched?

Auto configuration of players

A config handler for each player that reads the required parameters or sets default values would really ease the initial configuration step. Should make sure that it doesn't hijack the user's current setup, so probably have it as an opt-in in the install script, along with installed players detection.

"Check your PATH" in Ubuntu 18

Hi @iamkroot!

I'm way too stupid to fix the PATH issue in ubuntu (18.04.3 LTS)
All other Python related stuff works.
I did notice tho that with other scripts, i have to prefix with "pythonXX."

Can you help me out? :(

Trakt auth completed, stuck at:

/home/user/trakt-scrobbler-master/scripts/linux-install-service.sh
Checking poetry install.
Poetry not found. Installing.
  The script jsonschema is installed in '/home/user/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script doesitcache is installed in '/home/user/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script keyring is installed in '/home/user/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script pkginfo is installed in '/home/user/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  The script poetry is installed in '/home/user/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
You are using pip version 18.1, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
python -V
Python 3.6.9

[BUG] Scrobbler keeps dying after a few shows

Describe the bug
Hi there, the scrobbler keeps erroring out and dying after a few shows.

Desktop (please complete the following information):

  • OS: Windows
  • Python Version: 3.6.8
  • Player: VLC
  • Player Version: 3.0.8

To Reproduce
Steps to reproduce the behavior:

  1. Open any file
  2. Close it and play another
  3. Close player
  4. See error in log file

Log file

Click to see log contents

2019-11-29 16:45:33,485 - DEBUG - scrobbler - scrobbler - Adding item to history {'state': 2, 'progress': 93.69, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1571323903.0709527}
2019-11-29 16:45:33,485 - DEBUG - scrobbler - trakt_interface - Searching cache.
2019-11-29 16:45:42,481 - DEBUG - vlc - file_info - Filepath 'None'
2019-11-29 16:45:42,481 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 93, in run
    self.handle_status_update()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 69, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 29, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\file_info.py", line 45, in get_media_info
    file_path = Path(file_path)
  File "d:\python\Lib\pathlib.py", line 1001, in __new__
    self = cls._from_parts(args, init=False)
  File "d:\python\Lib\pathlib.py", line 656, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "d:\python\Lib\pathlib.py", line 640, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2019-11-29 16:46:37,077 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-11-29 16:46:37,077 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 90.49, 'media_info': {'type': 'movie', 'title': 'a bloddy anime afdsfas d'}, 'updated_at': 1567352435.157468}
2019-11-29 16:46:37,077 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:46:37,077 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 92.91, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1570449151.6798394}
2019-11-29 16:46:37,077 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:46:37,593 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 93.09, 'media_info': {'type': 'episode', 'title': 'Fate Grand Order', 'season': 1, 'episode': 2}, 'updated_at': 1571069057.9425116}
2019-11-29 16:46:37,593 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:46:37,860 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 92.62, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1571213034.0397353}
2019-11-29 16:46:37,860 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:46:38,102 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 93.69, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1571323903.0709527}
2019-11-29 16:46:38,102 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:46:38,391 - INFO - MainThread - monitor - Started monitor for vlc
2019-11-29 16:46:50,465 - DEBUG - vlc - file_info - Filepath 'None'
2019-11-29 16:46:50,465 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 93, in run
    self.handle_status_update()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 69, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 29, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\file_info.py", line 45, in get_media_info
    file_path = Path(file_path)
  File "d:\python\Lib\pathlib.py", line 1001, in __new__
    self = cls._from_parts(args, init=False)
  File "d:\python\Lib\pathlib.py", line 656, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "d:\python\Lib\pathlib.py", line 640, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2019-11-29 16:47:10,374 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-11-29 16:47:10,375 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 90.49, 'media_info': {'type': 'movie', 'title': 'a bloddy anime afdsfas d'}, 'updated_at': 1567352435.157468}
2019-11-29 16:47:10,375 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:47:10,375 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 92.91, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1570449151.6798394}
2019-11-29 16:47:10,375 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:47:10,898 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 93.09, 'media_info': {'type': 'episode', 'title': 'Fate Grand Order', 'season': 1, 'episode': 2}, 'updated_at': 1571069057.9425116}
2019-11-29 16:47:10,898 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:47:11,162 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 92.62, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1571213034.0397353}
2019-11-29 16:47:11,162 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:47:11,378 - DEBUG - MainThread - scrobbler - Adding item to history {'state': 2, 'progress': 93.69, 'media_info': {'type': 'movie', 'title': 'Babylon'}, 'updated_at': 1571323903.0709527}
2019-11-29 16:47:11,378 - DEBUG - MainThread - trakt_interface - Searching cache.
2019-11-29 16:47:11,801 - INFO - MainThread - monitor - Started monitor for vlc
2019-11-29 16:47:15,808 - INFO - vlc - monitor - Unable to connect to vlc. Ensure that the web interface is running.
2019-11-29 16:49:00,043 - DEBUG - vlc - file_info - Filepath 'None'
2019-11-29 16:49:00,043 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 93, in run
    self.handle_status_update()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 69, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 29, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\file_info.py", line 45, in get_media_info
    file_path = Path(file_path)
  File "d:\python\Lib\pathlib.py", line 1001, in __new__
    self = cls._from_parts(args, init=False)
  File "d:\python\Lib\pathlib.py", line 656, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "d:\python\Lib\pathlib.py", line 640, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType
2019-11-29 16:50:05,286 - DEBUG - MainThread - utils - C:\Users\giaco\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist.
2019-11-29 16:50:05,287 - DEBUG - MainThread - utils - C:\Users\giaco\AppData\Roaming\trakt-scrobbler\trakt_token.json doesn't exist.
2019-11-29 16:50:05,287 - INFO - MainThread - trakt_interface - Access token not found in config. Initiating device authentication.
2019-11-29 16:50:05,734 - INFO - MainThread - trakt_interface - Verification URL: https://trakt.tv/activate
2019-11-29 16:50:05,734 - INFO - MainThread - trakt_interface - User Code: FD96332A
2019-11-29 16:50:06,034 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2019-11-29 16:50:11,221 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2019-11-29 16:50:16,413 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2019-11-29 16:50:21,608 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2019-11-29 16:50:26,825 - INFO - MainThread - trakt_interface - Device auth successful.
2019-11-29 16:50:26,826 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-11-29 16:50:26,826 - DEBUG - MainThread - utils - C:\Users\giaco\AppData\Roaming\trakt-scrobbler\watched_cache.json doesn't exist.
2019-11-29 16:50:26,832 - INFO - MainThread - monitor - Started monitor for vlc
2019-11-29 16:50:27,367 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 88, in run
    self.update_status()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\vlc.py", line 40, in update_status
    status_data = self.sess.get(self.status_url).json()
  File "C:\Users\giaco\.virtualenvs\trakt-scrobbler-3Aa1h_Wh\lib\site-packages\requests\models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "d:\python\Lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "d:\python\Lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "d:\python\Lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2019-11-29 16:51:06,644 - DEBUG - MainThread - utils - C:\Users\giaco\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist.
2019-11-29 16:51:06,644 - INFO - MainThread - scrobbler - Started scrobbler thread.
2019-11-29 16:51:06,648 - INFO - MainThread - monitor - Started monitor for vlc
2019-11-29 16:51:10,659 - INFO - vlc - monitor - Unable to connect to vlc. Ensure that the web interface is running.
2019-11-29 16:51:20,705 - DEBUG - vlc - file_info - Filepath 'D:/giaco/Documents/Shows/The Apprentice UK/Season 2/The Apprentice UK.S02E10.Episode 10 - Season 2.avi'
2019-11-29 16:51:20,706 - DEBUG - vlc - file_info - Trying to match custom regex.
2019-11-29 16:51:20,706 - DEBUG - vlc - file_info - No regex matches for D:/giaco/Documents/Shows/The Apprentice UK/Season 2/The Apprentice UK.S02E10.Episode 10 - Season 2.avi
2019-11-29 16:51:20,706 - DEBUG - vlc - file_info - Using guessit module to match.
2019-11-29 16:51:20,919 - DEBUG - vlc - file_info - MatchesDict([('country', <Country [GB]>), ('season', 2), ('title', 'The Apprentice'), ('episode', 10), ('episode_title', 'Episode 10 - Season 2'), ('container', 'avi'), ('mimetype', 'video/avi'), ('type', 'episode')])
2019-11-29 16:51:20,919 - DEBUG - scrobbler - trakt_interface - Searching cache.
2019-11-29 16:51:20,919 - DEBUG - scrobbler - trakt_interface - Searching trakt.
2019-11-29 16:51:22,501 - DEBUG - scrobbler - trakt_interface - Trakt ID: 2457
2019-11-29 16:51:22,502 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': 2457}}, 'episode': {'season': 2, 'number': 10}}
2019-11-29 16:51:22,831 - INFO - scrobbler - scrobbler - Scrobble start successful.
2019-11-29 16:51:30,945 - DEBUG - scrobbler - trakt_interface - Searching cache.
2019-11-29 16:51:30,945 - DEBUG - scrobbler - trakt_interface - {'show': {'ids': {'trakt': 2457}}, 'episode': {'season': 2, 'number': 10}}
2019-11-29 16:51:31,184 - INFO - scrobbler - scrobbler - Scrobble stop successful.
2019-11-29 16:51:40,991 - DEBUG - vlc - file_info - Filepath 'None'
2019-11-29 16:51:40,991 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 93, in run
    self.handle_status_update()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 69, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 29, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\giaco\AppData\Local\trakt-scrobbler\file_info.py", line 45, in get_media_info
    file_path = Path(file_path)
  File "d:\python\Lib\pathlib.py", line 1001, in __new__
    self = cls._from_parts(args, init=False)
  File "d:\python\Lib\pathlib.py", line 656, in _from_parts
    drv, root, parts = self._parse_args(args)
  File "d:\python\Lib\pathlib.py", line 640, in _parse_args
    a = os.fspath(a)
TypeError: expected str, bytes or os.PathLike object, not NoneType

[BUG] Installation failed because of dbus-python

Describe the bug
dbus-python is not seen by virtualenv wheras it is installed and its installation in the venv fails.
Thanks in advance for investigation and your help.
Thanks for the already done work! :)

Desktop (please complete the following information):

  • OS: Ubuntu Disco
  • Python Version: 3.7.3
  • Player: N/A
  • Player Version: N/A
    -dbus-python Version: python3-dbus (1.2.8-3)

To Reproduce
Installation of trakt-scrobbler on Ubuntu.
See error in log file

Log file

Click to see log contents

aymeric@ricoh-xps:/home/Public/trakt-scrobbler-master$ ./scripts/linux-install-service.sh Checking pipenv install.

Checking config file
config.toml already exists in /home/aymeric/.config/trakt-scrobbler/.
Please ensure that it matches sample_config.toml, or the app may crash unexpectedly.

Installing to /home/aymeric/.local/trakt-scrobbler/
Installing dependencies from Pipfile.lock (b0e854)…
An error occurred while installing dbus-python==1.2.8; sys_platform != 'win32'! Will try again.
Ignoring pywin32: markers 'sys_platform == "win32"' don't match your environment
Ignoring win10toast: markers 'sys_platform == "win32"' don't match your environment
🐍 ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 16/16 — 00:00:08
Installing initially–failed dependencies…
Collecting dbus-python==1.2.8 ▉▉▉▉▉▉▉ 0/1 — 00:00:00
Using cached https://files.pythonhosted.org/packages/3f/e7/4edb582d1ffd5ac3c84188deea32e960b5c8c0fe1da56ce70224f85ce542/dbus-python-1.2.8.tar.gz

ERROR: Command errored out with exit status 1:
 command: /home/aymeric/.local/share/virtualenvs/trakt-scrobbler-sC3BQFdg/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-oowgpdhh/dbus-python/setup.py'"'"'; __file__='"'"'/tmp/pip-install-oowgpdhh/dbus-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
     cwd: /tmp/pip-install-oowgpdhh/dbus-python/
Complete output (7 lines):
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/aymeric/.local/share/virtualenvs/trakt-scrobbler-sC3BQFdg/lib/python3.7/site-packages/setuptools/__init__.py", line 18, in <module>
    import setuptools.version
  File "/home/aymeric/.local/share/virtualenvs/trakt-scrobbler-sC3BQFdg/lib/python3.7/site-packages/setuptools/version.py", line 1, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
----------------------------------------

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

☤ ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 0/1 — 00:00:01
Error while creating venv

Support for double episodes

Proper support for double episodes is required. Currently, even if guessit is able to identify the episodes, the data to be scrobbled is inaccurate as it contains a list of episode numbers instead of an integer.

[BUG] Episodes scrobbled with MPC-HC are scrobbled double sometimes

Describe the bug
When competing an episode, trakt-scrobbler sometimes scrobble the same episode twice with a (less than a) 1 minute interval between those scrobbles.

Desktop (please complete the following information):

  • OS: Windows 10 1607 Enterprise LTSB
  • Player: MPC-HC 32-bit
  • Player Version: 1.8.6
  • Trakt-scrobbler version: 43ec6d8 (latest commit: scripts: Install pipenv automatically in script)

To Reproduce
Steps to reproduce the behavior:

  1. Open a video file you want to play file
  2. Play untill the episode is over, seek a 5 to 15 seconds back into during playing the video file. If the video file has chapters, skip to a chapter one or two times during playback.
  3. Close the media player.
  4. See the issue in the log file.

Log file
https://gist.github.com/CypherNL/c958041a131c3e5b4863998f251d4a13

Run as background service

Add simple scripts to allow the program to start at system startup, and run as a background service.

[BUG] Unable to use Python 3 for environment

Describe the bug
When installing, everything goes fine until right at the end. The error message states:

Unable to use Python 3 for environment. __init__() got an unexpected keyword argument 'text'.

It occurs right after it tries to enable autostart. I checked my startup folder and no autostart batch script was created, so this leads me to believe the error happens somewhere around there. I've purposefully removed some sensitive information in the logs, such as my username on my PC as well as the Trakt authentication code.

Desktop (please complete the following information):

  • OS: Windows 10 v1909
  • Python Version: 3.6.4

To Reproduce
Steps to reproduce the behavior:

  1. Run the install.py script in Windows 10.

Log file

Click to see log contents

Starting installation for trakt-scrobbler
Installing to C:\Users\****\AppData\Local\trakt-scrobbler
Creating virtualenv trakt-scrobbler-1Assg8Lv-py3.6 in C:\Users\****\AppData\Local\pypoetry\Cache\virtualenvs
Installing dependencies from lock file


Package operations: 15 installs, 0 updates, 0 removals

  - Installing pywin32 (227)
  - Installing six (1.13.0)
  - Installing babelfish (0.5.5)
  - Installing certifi (2019.11.28)
  - Installing chardet (3.0.4)
  - Installing idna (2.8)
  - Installing pypiwin32 (223)
  - Installing python-dateutil (2.8.1)
  - Installing rebulk (2.0.0)
  - Installing urllib3 (1.25.7)
  - Installing appdirs (1.4.3)
  - Installing guessit (3.1.0)
  - Installing requests (2.22.0)
  - Installing toml (0.10.0)
  - Installing win10toast (0.9)
Copying config to C:\Users\****\AppData\Roaming\trakt-scrobbler\config.toml
Validating config file at C:\Users\****\AppData\Roaming\trakt-scrobbler
Starting device authentication
Trakt Scrobbler Open https://trakt.tv/activate in your browser and enter this code: ########
Trakt Scrobbler App authorized successfully.
Enabling autostart
Unable to use Python 3 for environment. __init__() got an unexpected keyword argument 'text'
2020-01-26 03:46:16,586 - DEBUG - MainThread - utils - C:\Users\****\AppData\Roaming\trakt-scrobbler\trakt_cache.json doesn't exist.
2020-01-26 03:46:16,587 - DEBUG - MainThread - utils - C:\Users\****\AppData\Roaming\trakt-scrobbler\trakt_token.json doesn't exist.
2020-01-26 03:46:16,587 - INFO - MainThread - trakt_interface - Access token not found in config. Initiating device authentication.
2020-01-26 03:46:17,188 - INFO - MainThread - trakt_interface - Verification URL: https://trakt.tv/activate
2020-01-26 03:46:17,189 - INFO - MainThread - trakt_interface - User Code: ########
2020-01-26 03:46:17,422 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2020-01-26 03:46:22,578 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2020-01-26 03:46:27,736 - DEBUG - MainThread - trakt_interface - Waiting for user to authorize the app.
2020-01-26 03:46:32,929 - INFO - MainThread - trakt_interface - Device auth successful.

Question

I'm fairly new at python so I'm sorry if it's a dumb question.
Does the CMD window have to be running for it work? If so, is there a way to hide it so it's not in the task bar all the time?

Edit: Ok I ended up understanding that I needed to restart the PC for it to start working while in the background so that is working fine now.
Unfortunately another issue remains, the episode gets added to the history twice. Any idea what's happening?

I checked the logs and everything seems to be going through twice https://i.gyazo.com/454c02a95d0900f3a30b2cedf7785fd9.png
There's only one instance of pythonw.exe on the task manager if that helps.

Edit again: Turns out it was because the script is listening for MPCBE and MPCHC using the same port causing it to register everything twice, I deleted the one I don't use and now works fine.
Welp looks like I figured everything out by myself lol all there's left to say is thanks for this great script man, it's super convenient. Have a nice day!

[BUG] Not scrobbling VLC playing GVFS urls

Describe the bug

Remote files mounted in Nautils (GNOME’s “Files“) are not scrobbled.

Desktop (please complete the following information):

  • OS: Ubuntu
  • Python 3.7.5
  • Player vlc
  • Player Version 3.0.8-0-gf350b6b5a7

To Reproduce
Steps to reproduce the behavior:

  1. Mount samba / sftp URL
  2. Open any file

Log file

WARNING - vlc - utils - Invalid file uri 'sftp://HOST/PATH/Urlencoded%20file%20name.mkv'

Issue using Python 3.8 with trakt-scrobbler.

I'm using Win10, i have downloaded Python 3.8 and all requierements (config file is good etc etc), but the main.py crashes at launch. When i try to launch it with the terminal i got this error :

C:\Users\Geekcat\AppData\Local\trakt-scrobbler>pipenv run python main.py Traceback (most recent call last): File "main.py", line 11, in <module> from scrobbler import Scrobbler File "C:\Users\Geekcat\AppData\Local\trakt-scrobbler\scrobbler.py", line 4, in <module> from notifier import notify File "C:\Users\Geekcat\AppData\Local\trakt-scrobbler\notifier.py", line 9, in <module> from win10toast import ToastNotifier File "C:\Users\Geekcat\.virtualenvs\trakt-scrobbler-PdssKQCW\lib\site-packages\win10toast\__init__.py", line 19, in <module> from win32api import GetModuleHandle ImportError: DLL load failed while importing win32api: Le module spécifié est introuvable.

i look on internet and i found this : https://stackoverflow.com/questions/58631512/pywin32-and-python-3-8-0

[BUG] VLC monitoring not working

Describe the bugS

  1. Wrong vlcrc_path
  2. get_media_info problem

Desktop (please complete the following information):

  • OS: Windows 10
  • Python Version: 3.8.2
  • Player: VLC 3.0.8

To Reproduce
Steps to reproduce the behavior:

  • Change config.toml to monitor VLC : monitored = ['vlc']
  • Kill pythonw.exe process and execute trakt-scrobbler.bat (or reboot)
  • Play a movie on VLC

Log file

  1. (At launch)
 - ERROR - MainThread - monitor - Config value autoload failed for vlc.
Traceback (most recent call last):
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 20, in __new__
    cls.config = cls.autoload_cfg()
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 36, in autoload_cfg
    loaders = getattr(cls, "read_player_cfg")(auto_keys)
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\vlc.py", line 49, in read_player_cfg
    raise FileNotFoundError(vlcrc_path)
FileNotFoundError: C:\Users\bonswouar\AppData\Roaming\vlc\vlc\vlcrc
  1. (When playing a video)
 - ERROR - vlc - main - Unhandled exception
Traceback (most recent call last):
  File "main.py", line 56, in run_with_except_hook
    run_original(*args2, **kwargs2)
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 140, in run
    self.handle_status_update()
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 114, in handle_status_update
    current_state = self.parse_status()
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\player_monitors\monitor.py", line 71, in parse_status
    media_info = get_media_info(self.status['filepath'])
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\file_info.py", line 47, in get_media_info
    if not whitelist_file(file_path):
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\file_info.py", line 17, in whitelist_file
    file_path = cleanup_encoding(file_path)
  File "C:\Users\bonswouar\AppData\Local\trakt-scrobbler\utils.py", line 63, in cleanup_encoding
    enc = sys.stdout.encoding
AttributeError: 'NoneType' object has no attribute 'encoding'

Notes

I did a dirty workaround for problem 1. although the original code seems correct, that's weird !
And no idea about problem 2.

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.