Kodi Community Forum

Full Version: TV Show Next Aired (Script) Addon, now w/TheTVDB data
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
@gemini88 
With help from @Angelinas  I have it working again.   Using TVdb API V2 1.0.34 and Next Aired 8.0.3, both direct from github.

I had to comment out some lines in the API V2 module as per the issue logged by 'berkhornet' on github.  

I can help out if you need some more info on how to do this.

Also, I have asked the TVdb people about the V2 API.  If I get an answer back I will post it here.

Many thanks to @Angelinas .
Yes brother I appreciate you would love the help I've done the deleting and added the line of code for replacement to the tmdb.py but still nothing I have 1.0.34 and 8.0.3
(2023-01-07, 01:30)gemini88 Wrote: [ -> ]Yes brother I appreciate you would love the help I've done the deleting and added the line of code for replacement to the tmdb.py but still nothing I have 1.0.34 and 8.0.3

I encourage you to install the Log Viewer addon so you can conveniently watch for errors.

First, make sure the Next Aired settings have "Today" selected and not "Monday" as start of the week.

The only other thing I had to do was comment out the following lines (add a # mark at the beginning of the line):

#            if cast:
#                for count, item in enumerate(cast):
#                    if count < 4:
#                        result["cast.%s.tvdbname" % count] = item["name"]
#                        result["cast.%s.tvdbrole" % count] = item["role"]
#                        result["cast.%s.tvdbthumb" % count] = "https://artworks.thetvdb.com/banners/%s" % item["image"] 
 


Around line 543

Be very careful typing.  Python will barf if you use a tab or put in the wrong number of leading spaces.  All you are doing is inserting a # character at the beginning of the line.  Don't insert or delete a space on another line.  

If you are getting the same error as I did then this should fix it. 

You said "tmdb.py".  That is incorrect.  The file you want is "thetvdb.py" and is in the directory

....addons/script.module.thetvdb/lib/


The first time it may take quite a while before you get a display.  If you watch the log and no errors are thrown then you should be confident it is working.  Go have a cup of tea while it crunches your library.

Let me know if you need help with the log viewer.
Lol yh that was the first to come to mind 🤣 tmdb.py I thought I saw that definitely didn't thanks brother I appreciate you. will follow instructions after I finish watching ginny and Georgia and I will also download log viewer as well
@mr.igor the last combination that I had was 1.0.34 and 8.0.3 and it wouldn't even open
@gemini88 
It is important for you to see the log file.

When I run "Next Aired", the first thing that gets logged is:

2023-01-06 23:01:28.251 T:5118 INFO <general>: initializing python engine. 2023-01-06 23:01:30.059 T:5118 INFO <general>: script.module.thetvdb --> Initialized

Then 10 seconds later:

2023-01-06 23:01:38.3>: Loading skin file: /storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.tv.show.next.aired/resources/skins/Default/1080i/script-NextAired-TVGuide2.xml, load type: LOAD_ON_GUI_INIT

When the display loads.
html:
2023-01-07 11:32:56.099 T:3982     INFO <general>: script.tv.show.next.aired --> TV Show - Next Aired version 8.0.2 stopped
2023-01-07 11:32:56.099 T:3982     INFO <general>: CPythonInvoker(6, /storage/.kodi/addons/script.tv.show.next.aired/service.py): script successfully run
2023-01-07 11:32:56.439 T:3982     INFO <general>: Python interpreter interrupted by user
2023-01-07 11:32:57.247 T:25592    INFO <general>: CAddonMgr::FindAddon: script.module.thetvdb v1.0.34 installed
2023-01-07 11:32:57.999 T:25592    INFO <general>: CAddonMgr::FindAddon: script.tv.show.next.aired v8.0.3 installed
2023-01-07 11:32:58.002 T:25727    INFO <general>: initializing python engine.
2023-01-07 11:32:58.937 T:25727    INFO <general>: script.tv.show.next.aired --> TV Show - Next Aired version 8.0.3 started
2023-01-07 11:32:58.953 T:25737    INFO <general>: initializing python engine.
2023-01-07 11:32:59.498 T:25737    INFO <general>: script.module.thetvdb --> Initialized
2023-01-07 11:32:59.533 T:25737    INFO <general>: script.module.thetvdb --> Exited
2023-01-07 11:32:59.533 T:25737    INFO <general>: CPythonInvoker(270, /storage/.kodi/addons/script.tv.show.next.aired/default.py): script successfully run
2023-01-07 11:32:59.930 T:25737    INFO <general>: Python interpreter stopped
2023-01-07 11:33:37.565 T:25848    INFO <general>: initializing python engine.
2023-01-07 11:33:38.070 T:25848    INFO <general>: script.module.thetvdb --> Initialized
2023-01-07 11:34:37.938 T:25988    INFO <general>: initializing python engine.
2023-01-07 11:34:38.924 T:25988    INFO <general>: Python interpreter stopped

and nothing shows up on the screen.
Change setings for script.tv.show.next.aired or delete Kodi\userdata\addon_data\settings.xml...you use old version settings.xml.
And now something new:

html:
2023-01-07 11:50:21.324 T:27858    INFO <general>: script.module.thetvdb --> Initialized
2023-01-07 11:50:23.212 T:27858    INFO <general>: Skipped 1 duplicate messages..
2023-01-07 11:50:23.212 T:27858 WARNING <general>: script.tv.show.next.aired --> Exception in resources.lib.main_module ! --> string indices must be integers
2023-01-07 11:50:23.222 T:27858    INFO <general>: script.module.thetvdb --> Exited
2023-01-07 11:50:23.222 T:27858    INFO <general>: CPythonInvoker(277, /storage/.kodi/addons/script.tv.show.next.aired/default.py): script successfully run
2023-01-07 11:50:23.861 T:27858    INFO <general>: Python interpreter stopped

(2023-01-07, 12:54)Angelinas Wrote: [ -> ]Change setings for script.tv.show.next.aired or delete Kodi\userdata\addon_data\settings.xml...you use old version settings.xml.
I did that, I see new settings.xml is created, then I set configuration to suite my needs as follow:
xml:

<settings version="2">
    <setting id="TodayStyle">true</setting>
    <setting id="WantYesterday">true</setting>
    <setting id="ScanDays" default="true">7</setting>
    <setting id="ScanDays2" default="true">15</setting>
    <setting id="ShowAllTVShowsOnHome" default="true">false</setting>
    <setting id="ImproveDates" default="true">false</setting>
    <setting id="ThumbType" default="true">0</setting>
    <setting id="XmlStyle">true</setting>
    <setting id="Update" default="true" />
    <setting id="Reset" default="true" />
</settings>


but still nothing is shows up but at least this warning:
Exception in resources.lib.main_module ! --> string indices must be integers
is no more.
Something is really wired.
I have deleted settings.xml, opened add-on settings and left default values and confirmed settings.xml file is created, then restarted Odroid-N2 and just after these actions:
html:

2023-01-07 12:11:32.030 T:3976     INFO <general>: script.tv.show.next.aired --> TV Show - Next Aired version 8.0.3 started
2023-01-07 12:11:32.039 T:4023     INFO <general>: initializing python engine.
2023-01-07 12:11:37.905 T:4023     INFO <general>: script.module.thetvdb --> Initialized
2023-01-07 12:11:37.921 T:4023     INFO <general>: script.tv.show.next.aired --> Updating TheTVDB info for all continuing Kodi tv shows...
2023-01-07 12:11:40.372 T:4023  WARNING <general>: script.tv.show.next.aired --> Exception in resources.lib.main_module ! --> string indices must be integers
2023-01-07 12:11:40.379 T:4023     INFO <general>: script.module.thetvdb --> Exited
2023-01-07 12:11:40.379 T:4023     INFO <general>: CPythonInvoker(12, /storage/.kodi/addons/script.tv.show.next.aired/default.py): script successfully run
2023-01-07 12:11:40.761 T:4023     INFO <general>: Python interpreter stopped
What a surprise... when I was scrolling my series library and pointed cursor over this series it popup on the bottom information about next season when starting :-)

Image

So apparently it works with reading information from tvdb but there is an issue with showing results on the screen.
which scraper you use ?
your scraper have showdetails["status"] and id is not from tvdb

Change this line in tvdb,py row 532-534
 
Code:
    def _map_series_data(self, showdetails):
        self._log_msg("Exception in get_series_data_tz %s--> " % (showdetails))
        result = {}
reset all data in script.tv.show.next.aired and read log in kodi...
something like this
 
Code:
2023-01-07 12:41:51.675 T:64696    INFO <general>: script.module.thetvdb --> Exception in get_series_data_tz {'id': 0, 'seriesId': '', 'seriesName': None, 'aliases': None, 'season': '', 'poster': '', 'banner': '', 'fanart': '', 'status': '', 'firstAired': '', 'network': '', 'networkId': '', 'runtime': '', 'language': '', 'genre': None, 'overview': None, 'lastUpdated': 0, 'airsDayOfWeek': '', 'airsTime': '', 'rating': None, 'imdbId': '', 'zap2itId': '', 'added': '', 'addedBy': None, 'siteRating': 0, 'siteRatingCount': 0, 'slug': ''}-->
2023-01-07 12:41:51.815 T:64696 WARNING <general>: script.tv.show.next.aired --> Exception in resources.lib.main_module ! --> string indices must be integers
that tvshow make isue.Rescrape with tvdb scraper that show.
@rafikW @Angelinas 

This is a known problem with TheTVdb API V2 addon as per this issue:

https://github.com/kodi-community-addons.../issues/11

Find and comment out the lines indicated at the end of the issue text.

As @Angelinas  said, identifying and rescraping the problem show should work but it will likely happen again if you have more in your library like that.
Guys,
I'm using "The TVDB v4" version 1.1.4 https://kodi.wiki/view/Add-on:The_TVDB_v4
I have added these lines:
self._log_msg("Exception in get_series_data_tz %s--> " % (showdetails))
        result = {}

as well as commented lines:
#if cast:
#for count, item in enumerate(cast):
#if count < 4:
#result["cast.%s.tvdbname" % count] = item["name"]
#result["cast.%s.tvdbrole" % count] = item["role"]
#result["cast.%s.tvdbthumb" % count] = "https://artworks.thetvdb.com/banners/%s" % item["image"]
following https://github.com/kodi-community-addons.../issues/11

result:
xml:
2023-01-07 15:36:46.421 T:32500    INFO <general>: script.module.thetvdb --> Exception in get_series_data_tz {'id': 257579, 'seriesId': '', 'seriesName': 'Magia Wielkiego Blekitu', 'aliases': [], 'season': '1', 'poster': 'posters/257579-1.jpg', 'banner': 'graphical/257579-g.jpg', 'fanart': '', 'status': 'Ended', 'firstAired': '', 'network': '', 'networkId': '', 'runtime': '1', 'language': 'en', 'genre': ['Documentary', 'Mini-Series'], 'overview': None, 'lastUpdated': 1617375008, 'airsDayOfWeek': '', 'airsTime': '', 'rating': None, 'imdbId': '', 'zap2itId': '', 'added': '2012-03-27 02:38:23', 'addedBy': 61565, 'siteRating': 9, 'siteRatingCount': 60, 'slug': 'magia-wielkiego-blekitu'}-->
2023-01-07 15:36:46.421 T:32500 WARNING <general>: script.tv.show.next.aired --> Exception in resources.lib.main_module ! --> local variable 'local' referenced before assignment
2023-01-07 15:36:46.432 T:32500    INFO <general>: script.module.thetvdb --> Exited

So as I understand the issue is caused by this series: https://thetvdb.com/series/magia-wielkiego-blekitu

but how to make it fixed?