Kodi Community Forum

Full Version: plugin.video.themoviedb.helper - Access to TheMovieDb API for Skinners
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Sorry. Thank you. Updated to Kodi 20.3 solved the issue
I get error on Kodi screen saying the moviedb helper error and it happens so frequent and this notifications takes like 10min before it disappears make it hard to watch anything so I looked into Kodi log and I found this error. I have the moviedb helper v 5.2.14

Code:
2024-01-14 22:04:12.388 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Deleting Corrupt File: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:12.390 T:11804   error <general>: XFILE::CFile:Big Grinelete - Error deleting file C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db
2024-01-14 22:04:12.392 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Initialising: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:12.395 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Exception while initializing _database: database disk image is malformed (1)
                                                   database_v6_TraktAPI.db_simplecache
2024-01-14 22:04:12.586 T:3036     info <general>: CVideoDatabase::UpdateDetailsForMovie: Finished updates for movie 3944
2024-01-14 22:04:23.228 T:4688     info <general>: CVideoPlayerAudio:TonguerocessDecoderOutput: Changed max allowed Out-Of-Sync value to 16 ms due self-learning
2024-01-14 22:04:24.685 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Deleting Corrupt File: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:24.685 T:11804   error <general>: XFILE::CFile:Big Grinelete - Error deleting file C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db
2024-01-14 22:04:24.686 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Initialising: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:24.690 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Exception while initializing _database: database disk image is malformed (0)
                                                   database_v6_TraktAPI.db_simplecache
2024-01-14 22:04:24.693 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   lib.addon.cache get_cache
                                                   Error Type: AttributeError
                                                   Error Contents: ('__enter__',)
                                                     File "C:\Users\<username>\AppData\Roaming\Kodi\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\logger.py", line 10, in wrapper
                                                       return func(self, *args, **kwargs)
                                                     File "C:\Users\<username>\AppData\Roaming\Kodi\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\bcache.py", line 34, in get_cache
                                                       return self._cache.get(cache_name, cur_time=cur_time)
                                                     File "C:\Users\<username>\AppData\Roaming\Kodi\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\scache.py", line 89, in get
                                                       return result or self._get_db_cache(endpoint, cur_time)  # Fallback to checking database if not in memory
                                                     File "C:\Users\<username>\AppData\Roaming\Kodi\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\scache.py", line 147, in _get_db_cache
                                                       cache_data = self._execute_sql(query, (endpoint,))
                                                     File "C:\Users\<username>\AppData\Roaming\Kodi\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\scache.py", line 270, in _execute_sql
                                                       with self._get_database() as _database:
                                                   
2024-01-14 22:04:25.032 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Deleting Corrupt File: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:25.032 T:11804   error <general>: XFILE::CFile:Big Grinelete - Error deleting file C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db
2024-01-14 22:04:25.033 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Initialising: C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6\TraktAPI.db...
2024-01-14 22:04:25.052 T:11804    info <general>: [plugin.video.themoviedb.helper]
                                                   CACHE: Exception while initializing _database: database disk image is malformed (2)
                                                   database_v6_TraktAPI.db_simplecache
Hi @jurialmunkey

May I ask you if I can use both the "Container method" and the "Classic method" in different windows with the service monitor.
However, I noticed that this could perhaps create problems for the service monitor.

Is it possible to use both methods in different windows, or is it advisable to use only one method for the entire skin?


Thank you so much for your help.
@nordicguy - Something is corrupted in the cache file folder and the plugin is unable to write or delete and restart a new cache file.

Close Kodi and delete the database_v6 folder and then restart Kodi and see if that helps. Otherwise I need a full log to have any idea what is happening.
C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6
(2024-01-15, 13:17)Andrea1998 Wrote: [ -> ]May I ask you if I can use both the "Container method" and the "Classic method" in different windows with the service monitor.
However, I noticed that this could perhaps create problems for the service monitor.

All that matters is whether the TMDbHelper.MonitorContainer setting is set. If it's set, service sets listitem to container ID. If it is empty, service sets properties to home window.

But this sounds like a bad idea and I have no idea why you would want to do this. If you're considering this it sounds like you misunderstand how things work.
(2024-01-16, 01:00)jurialmunkey Wrote: [ -> ]But this sounds like a bad idea and I have no idea why you would want to do this. If you're considering this it sounds like you misunderstand how things work.
Because in different windows I need to retrieve only one piece of information, and it didn't make sense for me to create an empty container every time in each window to retrieve the information, so I use the classic Window(Home) method.
While in other windows where I retrieve more information, I also need to retrieve ListItem.Duration + ListItem.EndTime, which I cannot do with the classic Window(Home) method but I have to use the container method to get ListItem.EndTime.

I can also use the Container method to retrieve information in each window, but I read that the classic one is global and works in all windows, while the Container method doesn't, so I haven't yet fully understood whether I can use it everywhere as I want.


I would just ask you to help me, it's hard to understand everything using only the wiki.


Thank you for all your help and work.
(2024-01-16, 15:31)Andrea1998 Wrote: [ -> ]Because in different windows I need to retrieve only one piece of information, and it didn't make sense for me to create an empty container every time in each window to retrieve the information, so I use the classic Window(Home) method.

Why is creating an empty container a problem? If you put the container in an include, then it's just one line of code you need to add to the window. That's what includes are for - so you don't need to retype code blocks that you reuse....

Define the container *once* in one of your skin's include files:

xml:

<include name="TMDbHelper_Hidden_Container">
<control type="list" id="99950">
<orientation>vertical</orientation>
<width>1</width>
<height>1</height>
<left>-3840</left>
<itemlayout width="1" height="1" />
<focusedlayout width="1" height="1" />
</control>
</include>

Then whenever you want to use it in a window, it's as simple as adding a single line:

xml:

<include>TMDbHelper_Hidden_Container</include>



(2024-01-16, 15:31)Andrea1998 Wrote: [ -> ]I can also use the Container method to retrieve information in each window, but I read that the classic one is global and works in all windows, while the Container method doesn't, so I haven't yet fully understood whether I can use it everywhere as I want.

You misunderstand what global and local means in this context. Nothing to do with what windows either method works in. Both work identically in terms of *getting* information for an item.

What differs in how they are *setting* the information so that you can access it in the skin.
  • The container method *sets* the info to a "local" container (i.e. always in the same window as item)
  • The property method *sets* the info to "global" properties in the home window (i.e. not necessarily in same window as item)

It's nearly always preferable to use container method because working with local listitems is far more convenient than window properties. The item you are getting info for is also local so the container method is the closest to working directly with the item.
I am using Aeon Nox SiLVO skin with Omega nightly 20240116 under Windows 10.

When starting a movie I often receive an error message that then goes away and the log shows this:

2024-01-18 15:24:02.518 T:11776    info <general>: [plugin.video.themoviedb.helper]
ConnectionError:  HTTPSConnectionPool(host='webservice.fanart.tv', port=443): Max retries exceeded with url: /v3/movies/65?api_key=fcca59bee130b70db37ee43e63f8d6c1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1136)')))
Suppressing retries for 30 seconds
(2024-01-16, 00:48)jurialmunkey Wrote: [ -> ]@nordicguy - Something is corrupted in the cache file folder and the plugin is unable to write or delete and restart a new cache file.

Close Kodi and delete the database_v6 folder and then restart Kodi and see if that helps. Otherwise I need a full log to have any idea what is happening.
C:\Users\<username>\AppData\Roaming\Kodi\userdata\addon_data\plugin.video.themoviedb.helper\database_v6

so I did that and the error is gone but I still cannot see additional ratings in any of the TV shows but they appear for all the movies even the newly added movies. any idea how to troubleshoot that?

nordicguy
(2024-01-17, 01:20)jurialmunkey Wrote: [ -> ]You misunderstand what global and local means in this context. Nothing to do with what windows either method works in. Both work identically in terms of *getting* information for an item.

Forgive me, yes I misunderstood its use, now is clearer.

I would also like to thank you very much for specifically showing me the code, I didn't think it could also be used inside the include, to use it only once.


Thanks for everything.
(2024-01-18, 16:44)ashlar Wrote: [ -> ]I am using Aeon Nox SiLVO skin with Omega nightly 20240116 under Windows 10.

When starting a movie I often receive an error message that then goes away and the log shows this:

2024-01-18 15:24:02.518 T:11776    info <general>: [plugin.video.themoviedb.helper]
ConnectionError:  HTTPSConnectionPool(host='webservice.fanart.tv', port=443): Max retries exceeded with url: /v3/movies/65?api_key=fcca59bee130b70db37ee43e63f8d6c1 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1136)')))
Suppressing retries for 30 seconds

There's not much I can do about an SSL certificate expiry. SSL certificates are managed by Kodi and the certificate issuer. If the website's SSL certificate has expired or Kodi can't authenticate it with the certificate authority or the certificate has expired in Kodi's cache then Kodi will refuse the connection as a safety precaution.

If a connection is refused, TMDbHelper suppresses making further requests to that API for a short period to avoid continually trying to re-request data from a server which isn't responding for whatever reason.

You can read more about how Kodi manages SSL here:
https://kodi.wiki/view/SSL_certificates
(2024-01-19, 07:24)jurialmunkey Wrote: [ -> ]There's not much I can do about an SSL certificate expiry. SSL certificates are managed by Kodi and the certificate issuer. If the website's SSL certificate has expired or Kodi can't authenticate it with the certificate authority or the certificate has expired in Kodi's cache then Kodi will refuse the connection as a safety precaution.

If a connection is refused, TMDbHelper suppresses making further requests to that API for a short period to avoid continually trying to re-request data from a server which isn't responding for whatever reason.

You can read more about how Kodi manages SSL here:
https://kodi.wiki/view/SSL_certificates
Sorry, I did not mean it was something you should be solving, not necessarily, I mean. If fanart.tv certificate has indeed expired I suppose it's all on their end. What surprised me is that if I used my browser to navigate to https://webservice.fanart.tv, the certificate there did not look expired. With the certificate (issued by Let's Encrypt) valid till Mon, 18 Mar 2024 03:32:54 GMT.

So something is... "strange" in the scenario? I posted here because I wanted to understand if this was a problem just on my end or if others were experiencing it. Also, is there something I could do from my end to gather more information regarding the error message (maybe an option in logging, to see what certificate Kodi is getting, compared to Firefox)?
@ashlar - I'd be fairly doubtful it's the website itself. But a web browser will use its own certificate store, so that'd explain different behaviour in web browser. I'm not seeing this issue myself on Kodi and I haven't really heard anyone else mention it, so I'd be leaning towards some issue on your end.

TMDbHelper uses script.module.requests for web requests, and I believe the requests module gets its cacert.pem file from script.module.certifi -- so making sure those modules are up-to-date would be the first thing to check (maybe you turned off auto-updates and its stuck on an old version where the certificate doesn't match up).

I'm not that knowledgable on how Kodi manages/stores SSL certs beyond that, so I can't really give more advice than that but it's at least a start.
(2023-11-26, 08:38)jurialmunkey Wrote: [ -> ]
(2023-11-25, 15:40)reitenth Wrote: [ -> ]can i use jellycon (files accessed through addon) for tmdbhelper library integration? or would i have to use jellyfin for kodi (files integrated into kodi)

There was a JellyCon player that someone made last year. Since I don't use that addon at all, I have no clue if it still works (or how well it works) -- but if it does, then TMDbHelper should work straight out of the box with JellyCon.

I think it might've been based off the EmbyCon one.

You can see the player files here:
https://github.com/jurialmunkey/plugin.v...lycon.json
https://github.com/jurialmunkey/plugin.v...entid.json

And there's extensive documentation of the player function here if it needs tweaking
https://github.com/jurialmunkey/plugin.v...r-Function

I'd be interested to know how you go with it! I'm assuming it's working since I haven't had any reports otherwise but it'd be nice to get a definite answer.

Installed directly from your repository on Omega 21. Can confirm JellyCon works with it fine, including Trakt. Direct Play and Search have no issues, both for existing files and non-existent files such as Masters of Air for example.
Thanks!!!
I just received an update to version 5.2.15 from ThemovieDb Helper.
Now I get this error more often when I scroll through the views.
I'm not sure yet how I can reproduce this error, but maybe this will help you.

Code:
2024-02-01 01:40:57.168 T:6140     info <general>: [plugin.video.themoviedb.helper]
                                                   lib.monitor.listitem.on_listitem
                                                   Error Type: RuntimeError
                                                   Error Contents: ('dictionary changed size during iteration',)
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\script.module.jurialmunkey\resources\modules\jurialmunkey\logger.py", line 63, in wrapper
                                                       return func(*args, **kwargs)
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\plugin.video.themoviedb.helper\resources\tmdbhelper\lib\monitor\listitem.py", line 367, in on_listitem
                                                       self.on_finalise()
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\plugin.video.themoviedb.helper\resources\tmdbhelper\lib\monitor\listitem.py", line 294, in on_finalise
                                                       func(
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\plugin.video.themoviedb.helper\resources\tmdbhelper\lib\monitor\listitem.py", line 285, in on_finalise_winproperties
                                                       self.set_properties(_item._itemdetails.listitem)
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\plugin.video.themoviedb.helper\resources\tmdbhelper\lib\monitor\common.py", line 312, in set_properties
                                                       self.set_indexed_properties(item.get('infoproperties', {}))
                                                     File "C:\TEST-KODI20_Nightly\portable_data\addons\plugin.video.themoviedb.helper\resources\tmdbhelper\lib\monitor\common.py", line 260, in set_indexed_properties
                                                       for k, v in dictionary.items():