Kodi Community Forum
[RELEASE] Trakt Utilities (addon for Trakt.tv usage) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: [RELEASE] Trakt Utilities (addon for Trakt.tv usage) (/showthread.php?tid=98582)



- othrayte - 2011-11-04

phil4v7 Wrote:I'm seeing behavior similar to what Jessev described. The script adds all of my shows to my trakt "Collections" and then turns around and deletes roughly 80% of them. I have 74 shows seen by xbmc and the trakt count reaches 74 at the midway point, then slides back down to 16-20 by the time it's done. I double and triple checked that I have cleaning turned off, but it really shouldn't matter as all of the same files exist that it just used to add the entries. The debug log is rather long, so I'll pastebin it and send it in a PM.

Edit: I put it in the PM, but adding here as well:
Ubuntu 11.04, XBMC compiled from git on 2011-11-02, TU 0.6.4
What scrapper are you using for your TV Shows, if you look through the end of your log file and see the shows it says that it can't find, are they in your collection?

As a temporary measure you could try to disable all of the 'cleaning' options within TU.

dsimages Wrote:The openelec machine is running xbmc 10.1 git e9e9099 and TU version 0.6.3.

I still do not know where TU is putting the logs. I have it enable in the config but no idea where its putting them.
I noticed that that is a really old copy of xbmc, is that from the dharma branch or the pre-eden one? It appears to be from March. If it is from March then it will only work with a much older version of TU, TU v0.6.3 requires builds from july 19th and ones after oct 4th (ish) need TU v0.6.4


- othrayte - 2011-11-04

dsimages Wrote:The openelec machine is running xbmc 10.1 git e9e9099 and TU version 0.6.3.

I still do not know where TU is putting the logs. I have it enable in the config but no idea where its putting them.

phil4v7 Wrote:This is the first time I've needed to hunt for logs as well. In my install, I found the TU logs as a part of the xbmc.log located at:

/home/USER/.xbmc/temp/xbmc.log

I don't know if openelec lays things out differently, but hopefully that'll get you started in the right direction.
TU just logs to xbmc's log file. Sorry if we didn't make that clear enough.


- phil4v7 - 2011-11-04

othrayte Wrote:What scrapper are you using for your TV Shows, if you look through the end of your log file and see the shows it says that it can't find, are they in your collection?

As a temporary measure you could try to disable all of the 'cleaning' options within TU.
Im using the tvdb scraper which seems to work fine for purposes of adding all of the shows. Then it just comes behind and deletes all of the work it did in the first half of the script. And yes, all of the shows its adding and later removing are part of my collection.

I already unchecked the cleanup checkboxes, but it still runs every time.


- othrayte - 2011-11-04

phil4v7 Wrote:Im using the tvdb scraper which seems to work fine for purposes of adding all of the shows. Then it just comes behind and deletes all of the work it did in the first half of the script. And yes, all of the shows its adding and later removing are part of my collection.

I already unchecked the cleanup checkboxes, but it still runs every time.
Ok, I'll have to check if I can reproduce this when I get back to my dev computer then.


- phil4v7 - 2011-11-04

othrayte Wrote:Ok, I'll have to check if I can reproduce this when I get back to my dev computer then.
Thanks - in the short term, I've added a "return" as the first line in my cleanTVShowCollection function and everything works as expected now. Obviously, that's only because I don't care about the cleanup, but it does what I need now, so I'm happy. I also downloaded a fresh version of xbmc as of about 15 min ago and kicked off a recompile. I'll report back later this evening if that changes things any.


- othrayte - 2011-11-04

othrayte Wrote:Ok, I'll have to check if I can reproduce this when I get back to my dev computer then.
Just checked and I'm not seeing this on my system with Nov 2 and v0.6.4.

phil4v7 Wrote:Thanks - in the short term, I've added a "return" as the first line in my cleanTVShowCollection function and everything works as expected now. Obviously, that's only because I don't care about the cleanup, but it does what I need now, so I'm happy. I also downloaded a fresh version of xbmc as of about 15 min ago and kicked off a recompile. I'll report back later this evening if that changes things any.
So there are two very odd things happening,
  1. TU runs the cleaning procedure even when you have it disabled
  2. When it gets a list of all shows it finds them but when it searches for individual show it can't find them

So my next questions are:
  1. Do you have multiple account or settings files on the system?
  2. Are you using a different db system for xbmc's library, like MySQL?
  3. You are building your own copies of xbmc, are you choosing to leave anything disabled?

Just to give you an idea about my thoughts, I would suspect multiple settings files to be messing with the enabling of cleaning.

If you don't mind I've made a new version of the sync_update.py file for you to try https://raw.github.com/othrayte/script.TraktUtilities/for_phil4v7/sync_update.py it has extra, relevant, debug output to xbmc's log file.


- phil4v7 - 2011-11-04

othrayte Wrote:So my next questions are:
  1. Do you have multiple account or settings files on the system?
  2. Are you using a different db system for xbmc's library, like MySQL?
  3. You are building your own copies of xbmc, are you choosing to leave anything disabled?
1) No, I only use one account to run xbmc. I have upgraded a number of times from one nightly to the next, I suppose it's possible I have some old remnants lying around that are no longer needed. One thing I do have that just occurred to me is tvshow.nfo and episode specific.nfo files stored in the data directories along with the episodes. Would those affect the behavior? I'll have to check when I get home to see if there's any correlation between nfo files and the 16-20 shows that aren't deleted from my collection.

2) No, I'm using whatever the default is... sqlite I think?

3) No, I'm using the default configure and make. I first started compiling xbmc when I tried to install it on a new version of ubuntu that wasn't yet officially supported. Now I just keep doing it because I like playing with the new features.


- othrayte - 2011-11-04

phil4v7 Wrote:1) No, I only use one account to run xbmc. I have upgraded a number of times from one nightly to the next, I suppose it's possible I have some old remnants lying around that are no longer needed. One thing I do have that just occurred to me is tvshow.nfo and episode specific.nfo files stored in the data directories along with the episodes. Would those affect the behavior? I'll have to check when I get home to see if there's any correlation between nfo files and the 16-20 shows that aren't deleted from my collection.

2) No, I'm using whatever the default is... sqlite I think?

3) No, I'm using the default configure and make. I first started compiling xbmc when I tried to install it on a new version of ubuntu that wasn't yet officially supported. Now I just keep doing it because I like playing with the new features.
No, I cant think of anything wrong with the nfo files, and everything else seems in order, next thing is that modified version.
For the modified version you will need to put it in place and restart xbmc. If it runs tv cleaning by default then it will show up in xbmc's log, otherwise you will need to run the cleaning manually.


- dsimages - 2011-11-04

Quote:I noticed that that is a really old copy of xbmc, is that from the dharma branch or the pre-eden one? It appears to be from March. If it is from March then it will only work with a much older version of TU, TU v0.6.3 requires builds from july 19th and ones after oct 4th (ish) need TU v0.6.4

Says it was compiled on oct-25-2011. I believe it is a pre-eden.


- othrayte - 2011-11-04

dsimages Wrote:Says it was compiled on oct-25-2011. I believe it is a pre-eden.
Hmm, must have got it wrong, ok, you should start by updating to v0.6.4 and we will go from there. The log file you are after is just xbmc's one, it should be called "xbmc.log".


- dsimages - 2011-11-04

othrayte Wrote:Hmm, must have got it wrong, ok, you should start by updating to v0.6.4 and we will go from there. The log file you are after is just xbmc's one, it should be called "xbmc.log".

Ok I got, FYI for Openelec users, you have to ssh to the box and run the "createlog" command. This will create a .tar with all logs inside the /Logfiles map.


Anyway, take a look at line 5 for xbmc version, lines 74-78, 96-102 (keyerror = "limits",

Let me know what you find. Log is here

EDIT: I also noticed that the Trakt plugin is not submitting to trakt.tv either.


- DejaVu - 2011-11-05

+1 for Scrobbling stopped on Pre-eden (31st Oct 2011) running v0.6.4

The ONLY mentions of Trakt in my Log is -
Code:
22:46:40 T:13047616   ERROR: CZeroconfAvahi::addService(): failed to add service named:XBMC JSONRPC@$(HOSTNAME) type:_xbmc-jsonrpc._tcp port:8082. Error:Invalid Error Code :/ FIXME!
22:46:40 T:3019893616   ERROR: /home/xbmc/.xbmc/addons/script.TraktUtilities/nbhttpconnection.py:22: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
                                              import sha
22:46:42 T:2998913904   ERROR: WEATHER: Unable to get data: Invalid License Key.



- othrayte - 2011-11-05

dsimages Wrote:Ok I got, FYI for Openelec users, you have to ssh to the box and run the "createlog" command. This will create a .tar with all logs inside the /Logfiles map.


Anyway, take a look at line 5 for xbmc version, lines 74-78, 96-102 (keyerror = "limits",

Let me know what you find. Log is here

EDIT: I also noticed that the Trakt plugin is not submitting to trakt.tv either.
Ok, so I was correct after all, that version of openelec was built recently from very old Dharma source code, as such it is unable to run TU. If you did want to run TU you would need a copy built from Eden source code, preferably the most recent versions.


- othrayte - 2011-11-05

DejaVu Wrote:+1 for Scrobbling stopped on Pre-eden (31st Oct 2011) running v0.6.4

The ONLY mentions of Trakt in my Log is -
Code:
22:46:40 T:3019893616   ERROR: /home/xbmc/.xbmc/addons/script.TraktUtilities/nbhttpconnection.py:22: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
                                              import sha
Hmm, so it wasn't working, you changed to v0.6.4, then it started working and now it has stopped working again. And there are no other TU messages in the log file. Have you got TU in debug mode, and could you upload a copy of the log when you do.


- halkeye - 2011-11-05

I got a bit more detailed error message. I looked back a few pages in the post and didn't see anyone else mention it. I hope it hasn't been mentioned before.

Quote:21:45:11 T:3016743792 ERROR: Error Type: <type 'exceptions.ValueError'>
21:45:11 T:3016743792 ERROR: Error Contents: time data u'' does not match format '%Y-%m-%d %H:%M:%S'
21:45:11 T:3016743792 ERROR: Traceback (most recent call last):
File "/home/halkeye/.xbmc/addons/script.TraktUtilities/service.py", line 67, in <module>
autostart()
File "/home/halkeye/.xbmc/addons/script.TraktUtilities/service.py", line 50, in autostart
syncSeenMovies(True)
File "/home/halkeye/.xbmc/addons/script.TraktUtilities/sync_update.py", line 577, in syncSeenMovies
movies_seen.append({'imdb_id': imdbid, 'title': xbmc_movies[i]['originaltitle'], 'year': xbmc_movies[i]['year'], 'plays': xbmc_movies[i]['playcount'], 'last_played': int(time.mktime(time.strptime(xbmc_movies[i]['lastplayed'], '%Y-%m-%d %H:%M:%S')))})
File "/usr/lib/python2.6/_strptime.py", line 454, in _strptime_time
return _strptime(data_string, format)[0]
File "/usr/lib/python2.6/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data u'' does not match format '%Y-%m-%d %H:%M:%S'