Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
  • 1
  • 38
  • 39
  • 40(current)
  • 41
  • 42
  • 47
Release TMDb TV Show scraper (Python - Default Matrix Scraper)
(2023-08-11, 20:01)jepsizofye Wrote: so my question is - is there another way i can call this scraper from my addon that will return the info tags that i can then present to kodi allowing my addon to be set as 'metadata.local'

or should i simply rewrite and use a new tmdb api key

Get your own key.  It is easy for TMDB and free.  Not so much for IMDB.  I have a TMDB API key for my Mezzmo artwork and trailer checkers.  I have an IMDB key for my own use through a third party.  It is cheap and works pretty good for personal uses.  I wouldn't recommend this IMDB approach for broad public use.  TMDB will also allow you to see usage stats on your key.


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
(2023-08-11, 23:29)pkscout Wrote: There is not. And it's honestly kind of an abuse of our API key to try and do it that way.  You risk our API getting revoked.  You should get your own API key to do whatever it is you're trying to do.

thanks for the reply i will find another way

re: abuse - i dont see it that way, i want to use it to scan items into kodi manually - as opposed to kodi doing it itself, the end result is the same, the scraper is being used to add items to kodi's database the process is just different
Reply
(2023-08-11, 23:58)jepsizofye Wrote: thanks for the reply i will find another way

re: abuse - i dont see it that way, i want to use it to scan items into kodi manually - as opposed to kodi doing it itself, the end result is the same, the scraper is being used to add items to kodi's database the process is just different

If you are just calling the Kodi scraper as part of inserting things into the Kodi database for playback like other content then I tend to agree.  If you are using the TMDB key as part of your addon to make direct TMDB calls (as I do in mine) then that could constitute abuse. 


Thanks,

Jeff
Running with the Mezzmo Kodi addon.  The easier way to share your media with multiple Kodi clients.
Service.autostop , CBC Sports, Kodi Selective Cleaner and Mezzmo Kodi addon author.
Reply
@pkscout For the past few days the scraper hasn't worked. Here's a full log:- https://pastebin.com/smCKHJUK

But the short is it seems to be throwing an error in ssl.py

Code:
2023-08-22 08:39:26.674 T:5991    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'TimeoutError'>
                                                   Error Contents: The read operation timed out
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/main.py", line 32, in <module>
                                                       router(sys.argv[2][1:])
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/actions.py", line 235, in router
                                                       get_episode_details(params['url'])
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/actions.py", line 178, in get_episode_details
                                                       episode_info = tmdb.load_episode_info(
                                                                      ^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/tmdb.py", line 276, in load_episode_info
                                                       ep_return['ratings'] = load_ratings(
                                                                              ^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/tmdb.py", line 306, in load_ratings
                                                       imdb_rating = imdbratings.get_details(imdb_id).get('ratings')
                                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py", line 41, in get_details
                                                       votes, rating = _get_ratinginfo(imdb_id)
                                                                       ^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/imdbratings.py", line 48, in _get_ratinginfo
                                                       response = api_utils.load_info(IMDB_RATINGS_URL.format(
                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/storage/.kodi/addons/metadata.tvshows.themoviedb.org.python/libs/api_utils.py", line 58, in load_info
                                                       response = urlopen(req)
                                                                  ^^^^^^^^^^^^
                                                     File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
                                                     File "/usr/lib/python3.11/urllib/request.py", line 519, in open
                                                     File "/usr/lib/python3.11/urllib/request.py", line 536, in _open
                                                     File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
                                                     File "/usr/lib/python3.11/urllib/request.py", line 1391, in https_open
                                                     File "/usr/lib/python3.11/urllib/request.py", line 1352, in do_open
                                                     File "/usr/lib/python3.11/http/client.py", line 1374, in getresponse
                                                     File "/usr/lib/python3.11/http/client.py", line 318, in begin
                                                     File "/usr/lib/python3.11/http/client.py", line 279, in _read_status
                                                     File "/usr/lib/python3.11/socket.py", line 706, in readinto
                                                     File "/usr/lib/python3.11/ssl.py", line 1278, in recv_into
                                                     File "/usr/lib/python3.11/ssl.py", line 1134, in read
                                                   TimeoutError: The read operation timed out
                                                   -->End of Python script error report<--

This doesn't seem to be an issue with tmdb's api as both JellyFin and Plex are still scanning files ok.
Reply
(2023-08-22, 09:52)roidy Wrote: @pkscout For the past few days the scraper hasn't worked. Here's a full log:- https://pastebin.com/smCKHJUK

But the short is it seems to be throwing an error in ssl.py

Looks like the error was when attempting to connect to IMDB for the ratings. I can look at trapping for that error and either do a retry or just skip the ratings, but that's about it.
Reply
That's odd, I don't even have IMDb rating turned on:-

Image
Reply
Ok, so I removed the code to lookup IMDb ratings and now things scan into the library fine:-

python:
    for rating_type in settings.RATING_TYPES:
        logger.debug('setting rating using %s' % rating_type)
        if rating_type == 'tmdb':
            ratings['tmdb'] = {'votes': the_info['vote_count'],
                               'rating': the_info['vote_average']}
        elif rating_type == 'imdb' and imdb_id:
            pass
            # imdb_rating = imdbratings.get_details(imdb_id).get('ratings')
            # if imdb_rating:
            #     ratings.update(imdb_rating)

I'm just not sure why the scrapper is even trying to lookup IMDb ratings when the setting is turned off. This also doesn't explain why it's suddenly just started erroring during IMDb lookups.
Reply
(2023-08-22, 13:37)roidy Wrote: Ok, so I removed the code to lookup IMDb ratings and now things scan into the library fine:-

python:
    for rating_type in settings.RATING_TYPES:
        logger.debug('setting rating using %s' % rating_type)
        if rating_type == 'tmdb':
            ratings['tmdb'] = {'votes': the_info['vote_count'],
                               'rating': the_info['vote_average']}
        elif rating_type == 'imdb' and imdb_id:
            pass
            # imdb_rating = imdbratings.get_details(imdb_id).get('ratings')
            # if imdb_rating:
            #     ratings.update(imdb_rating)

I'm just not sure why the scrapper is even trying to lookup IMDb ratings when the setting is turned off. This also doesn't explain why it's suddenly just started erroring during IMDb lookups.
Remember that every source ends up with it's own set of scraper settings, so if you change the settings in the add-on, you're really only changing the "default" settings for a new source.  You have to go to each source and change the scraper settings for the change to actually apply.  If you've done that and are still seeing IMDB lookups, post something here and I'll take a look.  It definitely shouldn't be looking at IMDB if you don't ask it to.

IMDB goes through phases where the block and unblock things depending on what kind of day the site admins are having.  If it was my choice, I would just not have the IMDB ratings at all, but they are important to enough people that I won't fight about it.  When it doesn't work I mostly just tell folks to try again a few days later and see if it's better.
Reply
Quote:Remember that every source ends up with it's own set of scraper settings

Right, sorry totally forgot that, yep IMDb ratings where turned on for my actual source.
Quote:IMDB goes through phases where the block and unblock things depending on what kind of day the site admins are having.  If it was my choice, I would just not have the IMDB ratings at all

Yep I don't even use them, I didn't realise I had turned them on when I set up the source. Turned them off now so all is good. Thanks for the reply.
Reply
I have read this : https://kodi.wiki/view/Add-on:TMDb_TV_Sh...ode_Orders

But it makes me loose the xml content of tvshow.nfo .
Is there a way to edit an xml tvshow.nfo to use a specific episode order from tmdb ?

Can we write the episode_group URL directly in the json ?

xml:
<episodeguide>{"tvmaze": "428", "tvrage": "2610", "tvdb": "71035", "tmdb": "https://www.themoviedb.org/tv/1429/episode_group/650d9fa693db92011bb85cd2", "imdb": "tt0162065"}</episodeguide>

Also, do I have to force a full show update when I change the episode order with the same scraper ?
Does Kodi read first the episodeguide from nfo or the one from its database ? Thanks.
Reply
(2023-10-16, 12:08)twolaw Wrote: Is there a way to edit an xml tvshow.nfo to use a specific episode order from tmdb ?
What exactly do you want to save from the nfo file?
Maybe you could try this... https://kodi.wiki/view/NFO_files/Combination

(2023-10-16, 12:08)twolaw Wrote: Can we write the episode_group URL directly in the json ?
No

(2023-10-16, 12:08)twolaw Wrote: Also, do I have to force a full show update when I change the episode order with the same scraper ?
Yes. And don't forget to renumber your episode files so they match the new order.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
(2023-10-16, 20:16)Karellen Wrote:
(2023-10-16, 12:08)twolaw Wrote: Is there a way to edit an xml tvshow.nfo to use a specific episode order from tmdb ?
What exactly do you want to save from the nfo file?

I save all my tvshows with xml export in shows folders, to be able to rescan my library when needed (reinstall) with perfect matching.
But when a tv show starts to have strange episode numbering because of tmdb rules differs from tvdb rules, I need to change the episodeguide source to keep Kodi getting metadata.

If I leave only the episode_group url in the tvshow.nfo I won't be able to change my scraper in the future (ex. use tvdb).
If I use combinaison nfo, I will have to remove/edit the url in the nfo to change my scraper in the future.
Reply
After I updated today to Kodi Omega Beta 1, I have problems with the addon. With version Alpha3 everything worked fine.
The problem seems to be in the Python script called by the addon to scrape.

Extraction of the kodi log:
https://paste.kodi.tv/koveyivore.kodi
Reply
(2023-10-19, 10:19)Fehritale Wrote: Extraction of the kodi log:
Please post the full log to Kodi Paste Site and provide the link.
My Signature
Links to : Official:Forum rules (wiki) | Official:Forum rules/Banned add-ons (wiki) | Debug Log (wiki)
Links to : HOW-TO:Create Music Library (wiki) | HOW-TO:Create_Video_Library (wiki)  ||  Artwork (wiki) | Basic controls (wiki) | Import-export library (wiki) | Movie sets (wiki) | Movie universe (wiki) | NFO files (wiki) | Quick start guide (wiki)
Reply
Updated my post. Thanks Smile

Needed to left some things not related to the plugin out of the log, because it is about 60MB big and was to big to post it full.
Reply
  • 1
  • 38
  • 39
  • 40(current)
  • 41
  • 42
  • 47

Logout Mark Read Team Forum Stats Members Help
TMDb TV Show scraper (Python - Default Matrix Scraper)0