Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[macOS 10.12.5] TraktForVLC doesn't change the pin into token and strange error #73

Closed
Francis2b opened this issue Jul 15, 2017 · 18 comments
Labels

Comments

@Francis2b
Copy link

Hi,

I open this issue #72 I think I finaly manage to install everything but now I have a strange issue:

TraktForVLC doesn't change the pin into token in the ini file and I have this message:

`Francoiss-MacBook-Pro:~ Francois$ python /Users/Francois/TraktForVLC/TraktForVLC.py
Traceback (most recent call last):
File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 875, in
daemon=(should_daemon or pidfile))
File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 225, in init
self.__check_version()
File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 100, in __check_version
url="https://api.github.com/repos/XaF/TraktForVLC/releases")
File "/Users/Francois/TraktForVLC/requests/api.py", line 68, in get
return request('get', url, **kwargs)
File "/Users/Francois/TraktForVLC/requests/api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "/Users/Francois/TraktForVLC/requests/sessions.py", line 464, in request
resp = self.send(prep, **send_kwargs)
File "/Users/Francois/TraktForVLC/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/Users/Francois/TraktForVLC/requests/adapters.py", line 415, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', error(54, 'Connection reset by peer'))
Francoiss-MacBook-Pro:~ Francois$

`

@thebluepotato
Copy link

Finally fixed my issue with listening on 4222 (now working) and I'm now at the same error as you are! Will be looking for a solution...

@Francis2b
Copy link
Author

Keep in mind I'm working with TraktForVLC-1.3.0-rc2 ;)

@thebluepotato
Copy link

Well I'm using rc5 now (which caused my issues with missing frameworks like you had) and I've just redone the PIN part (i.e. stop TraktForVLC using launchctl unload /path/to/org.TraktForVLC.plist, get the PIN from Trakt, put it into config.ini and start TraktForVLC again) and it's working flawlessy now!

@Francis2b
Copy link
Author

It'll be so much easier with a step by step tutorial for mac with all the commands you need to put in terminal

@thebluepotato
Copy link

thebluepotato commented Jul 15, 2017

You mean for the PIN? Then here's my steps:

  • Stop TrakForVLC. Assuming you launched it through it's plist file : launchctl unload ~/Library/LaunchAgents/org.TraktForVLC.plist
  • Go to https://trakt.tv/pin/2498 and copy the pin it gives you
  • In the config.ini file inside your TraktForVLC folder, remove the tokens in your [Trakt] section and write PIN = [the PIN you just copied] without the brackets. Save and close the file.
  • Start TraktForVLC again using launchctl load ~/Library/LaunchAgents/org.TraktForVLC.plist.
  • Check the tokens are updated by opening config.ini again.

If you meant changing the instructions in the README, I'm all for it!

@Francis2b
Copy link
Author

For the whole install process of TraktForVLC ;) Beause it's a little bit tedious to get it work on MacOS. ASAP I get it work I think I'm gonna write it!

@XaF
Copy link
Owner

XaF commented Jul 16, 2017

It's kind of difficult for me to keep up to date a step by step guide for Mac. Mac steps are actually user-contributed as I don't have a Mac myself. If you're up to update the README file with accurate information and that someone else can corroborate them (as I cannot myself), I'd be really happy to receive that pull request :)

@Francis2b
Copy link
Author

If I manage to get it work I'll write something to help MacOS users ;)

@XaF
Copy link
Owner

XaF commented Jul 16, 2017

Are you still having the problem you reported before? If so, it seems TraktForVLC is unable to contact the URL api.github.com to check for new releases. It is weird though as that url should be accessible, but it's true that there is no error management on that part currently (TraktForVLC 1.x is considered as working online only... Plan for 2.x is to make it work offline too)

@Francis2b
Copy link
Author

I started all over with the lastest update but still the same probelem the plist file is loaded but in config.ini the PIN is still there. It didn't get a token. I might run it in debug mode but I don't know the command.

@thebluepotato
Copy link

Mac user to the rescue : I know there is a launchctl debug command but frankly I think it's overcomplicated. Add the following keys in you plist:

  • <string>--loglevel=INFO</string> inside the ProgramArguments array so you get more information on what TraktForVLC is doing.
  • Add two keys for log files, <key>StandardOutPath</key> and <key>StandardErrorPath</key>, both followed by <string>/path/to/your/deisred/logfile.log</string>

Then just stop and restart the service with unload and load and it'll output everything to said log file. The file doesn't get deleted on restarts.
Here's how my plist looks:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>org.user.TraktForVLC</string>
    <key>ProgramArguments</key>
        <array>
            <string>/usr/bin/python</string>
            <string>/Applications/TraktForVLC/TraktForVLC.py</string>
            <string>--loglevel=INFO</string>
        </array>
        <key>WorkingDirectory</key>
        <string>/Applications/TraktForVLC/</string>
        <key>StandardOutPath</key>
        <string>/Applications/TraktForVLC/logs/agentlog.log</string>
        <key>StandardErrorPath</key>
        <string>/Applications/TraktForVLC/logs/agentlog.log</string>
        <key>RunAtLoad</key>
        <true/>
        <key>LaunchOnlyOnce</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
    </dict>
</plist>

@Francis2b
Copy link
Author

Francis2b commented Jul 16, 2017

OMG nothing goes inside my log folder :(

here my plist:

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.user.TraktForVLC</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</string>
        <string>/Users/Francois/TraktForVLC/TraktForVLC.py</string>
	<array>
            <string>/usr/bin/python</string>
            <string>/Users/Francois/TraktForVLC/TraktForVLC.py</string>
            <string>--loglevel=INFO</string>
        </array>
        <key>WorkingDirectory</key>
        <string>/Users/Francois/TraktForVLC/</string>
        <key>StandardOutPath</key>
        <string>/Users/Francois/TraktForVLC/logs/agentlog.log</string>
        <key>StandardErrorPath</key>
        <string>/Users/Francois/TraktForVLC/logs/agentlog.log</string>
        <key>RunAtLoad</key>
        <true/>
        <key>LaunchOnlyOnce</key>
        <true/>
        <key>KeepAlive</key>
        <true/>
    </dict>
</plist>

@thebluepotato
Copy link

Yep I'm guessing the service didn't even start. launchctl has the dreadful habit of not telling you if a service has started or not (which was why I discovered the missing packages issue only when starting the script directly).
The service isn't starting because the plist is malformed. The ProgramArguments key is basically what you'd see in the command line, so python TraktForVLC.py --loglevel=INFO would be your command and that becomes three items:

  • Path to python
  • Path to TraktForVLC script
  • Argument(s)

You have put an array inside this array of Program Arguments effectively "doubling" the arguments and there's no closing </array> which means the plist can't be read.
Your fixed plist is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>org.user.TraktForVLC</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Library/Frameworks/Python.framework/Versions/2.7/bin/python</string>
		<string>/Users/Francois/TraktForVLC/TraktForVLC.py</string>
		<string>--loglevel=INFO</string>
	</array>
	<key>WorkingDirectory</key>
	<string>/Users/Francois/TraktForVLC/</string>
	<key>StandardOutPath</key>
	<string>/Users/Francois/TraktForVLC/logs/agentlog.log</string>
	<key>StandardErrorPath</key>
	<string>/Users/Francois/TraktForVLC/logs/agentlog.log</string>
	<key>RunAtLoad</key>
	<true/>
	<key>LaunchOnlyOnce</key>
	<true/>
	<key>KeepAlive</key>
	<true/>
</dict>
</plist>

@Francis2b
Copy link
Author

Here the log while watching a video:

2017-07-16 12:36:52,048::TraktForVLC::INFO::## TraktForVLC v1.3.0-rc5 Breaking Bad
2017-07-16 12:36:52,048::TraktForVLC::INFO::## Copyright (C) 2014-2015  Raphaël Beamonte <raphael.beamonte@gmail.com>
2017-07-16 12:36:52,048::TraktForVLC::INFO::##
2017-07-16 12:36:52,048::TraktForVLC::INFO::## TraktForVLC is distributed in the hope that it will be useful, but
2017-07-16 12:36:52,048::TraktForVLC::INFO::## with ABSOLUTELY NO WARRANTY. This is free software; you are welcome
2017-07-16 12:36:52,048::TraktForVLC::INFO::## to redistribute and/or modify it under the terms of the GPL2.
2017-07-16 12:36:52,048::TraktForVLC::INFO::
2017-07-16 12:36:52,304::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api.github.com
2017-07-16 12:36:52,914::TraktForVLC::INFO::VERSION:TraktForVLC is up to date
2017-07-16 12:36:52,915::TraktForVLC::INFO::Logger level is set to INFO
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Will scrobble movies ? Yes
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Will scrobble tv shows ? Yes
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Will we mark movies as being watched ? Yes
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Will we mark tv shows as being watched ? Yes
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Videos will be scrobbled after 90% of their duration has been exceeded
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Timer set to 60 secs
2017-07-16 12:36:52,915::TraktForVLC::INFO::-- Video will be marked as "is watching" from 30 secs
2017-07-16 12:36:52,915::TraktForVLC::INFO::Listening VLC to localhost:4222
2017-07-16 12:37:56,815::TraktForVLC::INFO::Cops - 30x05 state : 1%

In the ini file now there is token lines and when I connect to trakt.tv there is now the progress bar of what I'm watching but when I fast forward to 2min before end and let it finish (I already watch the video) in order to make it marked as watched it doesn't mark it as watched on trakt.tv but the progressbar keeps going on.

Is this behavior normal?

@thebluepotato
Copy link

I think it is, but you should check that your config.ini is set to scrobble tv shows and also look at what the logs are telling you after you've skipped to the end of your episode.

@Francis2b
Copy link
Author

Francis2b commented Jul 16, 2017

Scrobble tv shows is ON and here what it says from the omment I start to play the video:

2017-07-16 12:36:52,915::TraktForVLC::INFO::Listening VLC to localhost:4222
2017-07-16 12:37:56,815::TraktForVLC::INFO::Cops - 30x05 state : 1%
2017-07-16 12:38:56,819::TraktForVLC::INFO::Cops - 30x05 state : 7%
2017-07-16 12:38:56,905::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api-v2launch.trakt.tv
2017-07-16 12:38:57,306::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api-v2launch.trakt.tv
2017-07-16 12:38:57,685::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api-v2launch.trakt.tv
2017-07-16 12:38:58,090::TraktForVLC::ERROR::An error occurred while trying to mark as watching Cops - 30x05
Traceback (most recent call last):
  File "/Users/Francois/TraktForVLC/TraktForVLC.py", line 554, in main
    self.get_episode(video))
  File "/Users/Francois/TraktForVLC/TraktClient.py", line 420, in startWatching
    return self.__watching('start', imdb_id, progress, episode)
  File "/Users/Francois/TraktForVLC/TraktClient.py", line 377, in __watching
    progress=progress)
  File "/Users/Francois/TraktForVLC/TraktClient.py", line 416, in __watchingEpisode
    return self.__scrobble(action, data)
  File "/Users/Francois/TraktForVLC/TraktClient.py", line 351, in __scrobble
    self.__scrobble(action, data, True)
  File "/Users/Francois/TraktForVLC/TraktClient.py", line 358, in __scrobble
    stream.reason))
TraktError: Unable to start episode: 404 Not Found
2017-07-16 12:39:58,096::TraktForVLC::INFO::Cops - 30x05 state : 12%
2017-07-16 12:39:58,098::requests.packages.urllib3.connectionpool::INFO::Starting new HTTPS connection (1): api-v2launch.trakt.tv
2017-07-16 12:39:59,082::TraktForVLC::INFO::Cops - 30x05 is currently watching on Trakt...
2017-07-16 12:40:59,159::TraktForVLC::INFO::Cops - 30x05 state : 97%

There are some errors but I don't know if it's normal.

Edit: And when the progressbar is hitting the end it doesn't mark it as watched

@thebluepotato
Copy link

thebluepotato commented Jul 16, 2017

As a rule of thumb, errors are never a good thing. From the timeline of the log, the error happened before you skipped forward (7-12%) and it's going fine afterwards so I'm guessing that's just a random error. However I'm seeing the same issue as you, namely that Trakt correctly sees the episode as being watched but no scrobbling request seems to be sent as my episode isn't marked as watched. This should, once again, be part of a new issue since the PIN and the strange error issues have been resolved.

@Francis2b
Copy link
Author

I'm gonna open a new issue I guess ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants