henryjfry / repository.thenewdiamond

9 stars 4 forks source link

Trakt not working #17

Closed Tiagomartires1983 closed 1 year ago

Tiagomartires1983 commented 1 year ago

Using Libreelec 10.95.1 , kernel 6.1.11 , Windows system X11 , Kodi 20.0-Nexus Diamond Info_Mod 7.54 The MovieBd Helper 5.1.2

Track is not working , I try delete addon data from this 2 addons and reconnect Trakt but no joy . i try install other versions of Moviedb and Diamond but no joy.

Trak is connected on Moviedb Helper but the addon Diamond Info for some reason is not working and downloading the information .

Sending kodi log , if ytou can help me will be appreciated.

kodi.log

henryjfry commented 1 year ago

Ok your log is showing a problem with the trakt token coming back from tmdbhelper settings

So in the tmdbhelper settings.xml file in it's userdata folder what does the trakt_token setting look like.

Here is mine, with some stuff redacted:

<setting id="trakt_token">{&quot;access_token&quot;:&quot;TOKEN38cd5eedebfbad9a9d1396c&quot;,&quot;token_type&quot;:&quot;bearer&quot;,&quot;expires_in&quot;:7776000,&quot;refresh_token&quot;:&quot;TOKENce51d1fc2897d4d640&quot;,&quot;scope&quot;:&quot;public&quot;,&quot;created_at&quot;:1671610407}</setting>
henryjfry commented 1 year ago

It looks for "<setting id="trakt_token">" and also "</setting>"

Tiagomartires1983 commented 1 year ago

ok , So what i can do fix this?

<setting id="trakt_token">{&quot;access_token&quot;:&quot;921accedfb470ffbfe850ab128e6f50d6c33a54ee17fbfddb897a34403ca521f&quot;,&quot;token_type&quot;:&quot;bearer&quot;,&quot;expires_in&quot;:7776000,&quot;refresh_token&quot;:&quot;cdb6bca15529b2ec53b8b80ac6be2ad33a7112fb60f2608c7fa3166eefb96a26&quot;,&quot;scope&quot;:&quot;public&quot;,&quot;created_at&quot;:1677607823}</setting>

mine is like that

henryjfry commented 1 year ago

Ok not sure why that wouldnt work as it looks ok, unless there is a new line character or something messing things up.

If you wanted to try something you could change this:

    import html
    f = open(tmdb_settings, 'r')
    for x in f:
        if 'trakt_token' in x:
            trakt_token = x.split('</setting>')[0].split('<setting id="trakt_token">')[1]
            trakt_token = eval(html.unescape(trakt_token))
    f.close()
    del html

For this:

    import html
    trakt_token = xbmcaddon.Addon('plugin.video.themoviedb.helper').getSetting('trakt_token')
    trakt_token = eval(html.unescape(trakt_token))
    del html

In "script.diamondinfo/resources/lib/library.py"

And let me know if it works. Otherwise wait till I get home and can push an update.

Tiagomartires1983 commented 1 year ago

It works mate , now Track is working and no errors ,

on next update i need to change this again or you will do it from your end?

Thank you , and keep the good work

henryjfry commented 1 year ago

Yeah I'll apply that change at my end. It really should have been setup like that all along. But i'm an "if it aint broke don't fix it" kind of coder.

henryjfry commented 1 year ago

closed with update