trakt / script.trakt

Trakt.tv movie and TV show scrobbler for Kodi
GNU General Public License v2.0
318 stars 149 forks source link

Not detecting LiveTV / PVR use #31

Closed andyb2000 closed 11 years ago

andyb2000 commented 11 years ago

Unsure if this has been looked into as cannot find documentation to support it. The trakt script appears to detect that livetv is starting to be watched (In my case using TVHeadend and pvr.hts client in XBMC), but then almost immediately stops.

Code in debugging appears to show that the script.trakt isn't picking up on the data correctly, which may need some add-on tweaking to integrate with pvr plug-ins. Happy to assist in coding if this is something that would make sense?

14:57:06 T:3016709888 DEBUG: CGUIInfoManager::SetCurrentMovie(pvr://channels/tv/All TV channels/1.pvr) 14:57:06 T:3016709888 DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc 14:57:06 T:3016709888 DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPlay 14:57:06 T:3016709888 DEBUG: Building didl for object 'pvr://channels/tv/All TV channels/1.pvr' 14:57:06 T:2978999104 NOTICE: [trakt] [Notification Service] message: {u'params': {u'data': {u'item': {u'channeltype': u'tv', u'type': u'channel', u'id': 4, u'title': u'BBC Two England'}, u'player': {u'playerid': 1, u'speed': 1}}, u'sender': u'xbmc'}, u'jsonrpc': u'2.0', u'method': u'Player.OnPlay'} 14:57:06 T:2978999104 NOTICE: [trakt] [Scrobbler] Watching: channel 14:57:06 T:2978999104 DEBUG: NEWADDON PythonCallbackHandler construction with PyThreadState 0xb8dc5a0 14:57:06 T:2978999104 NOTICE: [trakt] [Scrobbler] Suddenly stopped watching item

So it appears the trakt notification is only picking up the basic info for the channel and not the extended info that would contain the program name being watched for accurate trakt logging.

Pls get in touch if I can assist

rectifyer commented 11 years ago

Hmm, I don't have a tv tuner or a way to test out the PVR functionality. It sends an event though, so it's possible trakt can somehow use that info. It only shows the channel you are watching right now, any ideas if it sets other metadata like the show/season/episode or movie title/year? We would need some sort of identifying info of what's on to attempt to find it on trakt.

andyb2000 commented 11 years ago

Thanks @rectifyer I've actually made a start on it in my own fork at (https://github.com/andyb2000/script.trakt) so will do some progress and hopefully send a PR in. There should be enough info, I'm also on dev for TVH so should be able to get enough info presented to the PVR if we don't get enough. I've got a fair bit coming through now, example here:

17:21:20 T:2978470720 NOTICE: [trakt] [Scrobbler] Watching: channel 17:21:21 T:2978470720 NOTICE: [trakt] [Scrobbler] Warning: Cant find playlist length?!, assuming that this item is by itself 17:21:21 T:2978470720 NOTICE: [trakt] [Player.GetItem] {"id":1,"jsonrpc":"2.0","result":{"item":{"episode":-1,"fanart":"","id":4,"label":"BBC Two England","plot":"19/26. Eston: Michael Aspel and a team of experts examine curios and artefacts offered up by the public in Eston. Exciting finds include a sculpted elephant by Eduardo Paolozzi. [S]","season":-1,"showtitle":"","thumbnail":"image://http%3a%2f%2f192.168.55.3%3a9981%2fimagecache%2f26/","title":"Vintage Antiques Roadshow","tvshowid":-1,"type":"channel","year":0}}}

Will get back on progress.

andyb2000 commented 11 years ago

@rectifyer Could you comment on the following as I don't know enough of the trakt system. This is the full info I can get from a Player.GetItem request on a tv channel:

10:32:11 T:2961685312 NOTICE: [trakt] [Player.GetItem] {"id":1,"jsonrpc":"2.0","result":{"item":{"episode":-1,"fanart":"","id":4,"label":"BBC Two England","plot":"David Dimbleby chairs from Stirling with Michael Moore MP; Humza Yousaf MSP, Lord Falconer, Mary Macleod MP, and Sir Brian Souter, Chief Executive of Stagecoach Group. [S]","season":-1,"showtitle":"","thumbnail":"image://http%3a%2f%2f192.168.55.3%3a9981%2fimagecache%2f26/","title":"Question Time","tvshowid":-1,"type":"channel","uniqueid":{"unknown":""},"year":0}}}

Looking at this, there isn't much information passed through, is there enough here to try and scrobble (I'm thinking all you could do was use the title of the program 'Question Time', channel perhaps 'BBC Two England' and possibly the plot 'David Dimpleby...' to scrobble, or would it need a lot more?

rectifyer commented 11 years ago

Some recent updates were made in 2.1 for streaming content. It doesn't look like the PVR returns enough info to identify what's playing, but give it a try and see.

rectifyer commented 11 years ago

Any luck with 2.1 identifying the content better?

rectifyer commented 11 years ago

Closing this topic, but please try 2.2 and see if it works better at all. I think its just a limitation of the OSD data for live tv though and not much we can use.

andyb2000 commented 11 years ago

Thanks @rectifyer Understandable, will give it a go but suspect alternative services (currently speaking to Zeebox and writing my own script to push to this) might match better for livetv. Thanks again for your help.