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.
(2022-12-06, 13:31)Gade Wrote: [ -> ]
(2022-12-05, 15:10)skippr Wrote: [ -> ]@Gade 

This is utterly astonishing. At some point the TV Show Next Aired Addon broke, and the only solution I found was using Marcelveidt's version. 
After a few bumps it suddenly seemed to work, so I assumed that did the trick. Not even imagining that meanwhile this feature was provided otherwise! Who knew?! And TBH, I never would have assumed this functionality based on the names of the scripts. 

Wow! Kudos to Rapier that it implements this great feature! 

I just hope this helps all those non-Rapier users, and that their skins support these scripts and plugin.

Thanks, I removed support for tv.show.next.aired as it stopped working properly.
I looked for another solution for Rapier, as I use tv shows a lot myself and found script.embuary.info.
It provides a lighter and faster version.

Other skins can do the same, but it requires skin code changes.

latts I thought drawing your attention to this post may be easier than doing another private message.....
Unless this is a big load, it looks like "script.embuary.info" could be integrated into MQ8 to replace "TV Next Aired".
I have already done a work around with good results. 

Let me know what you think.
Thanks buddy
An FYI for people who have installed Next Aired and associated dependencies but find it does not work:

1. script.module.thetvdb v 1.32 is broken and does not work with next aired.  Throws a "string indices must be integers" error.   This has been reported but no one seems to be looking at it right now.   Thank heavens for version control and github.  Use 1.31

2. If you run Next Aired and it throws  an error for "airdatetime", the problem is likely bad data from TheTVdb api.   I have seen this a few times now, the last time with the show "Happy Valley".   Note that the web interface on TheTVdb will be correct but the api data is corrupt.   I removed Happy Valley from the Kodi db and Next Aired started working again.    After a few weeks of this the api data was fixed and it all started working again.  If you have the patience and skill you can track down what is wrong and send in a bug report to TheTVdb.   They are quite responsive if you give them something to work with.   Don't just say "something is wrong with show x".  

3. This is for people who are comfortable with surfing the Kodi file structure and editing addon code.   You don't have to be a programmer, just willing to muck about in a reasonable way.

You can determine which show is causing the problem by inserting a log message (in green below) into script.module.thetvdb, in the file "thetvdb.py":

    def get_unaired_episodes(self, seriesid):
            Returns the unaired episodes for the specified seriesid
            Usage: specify the series ID: TheTvDb().get_unaired_episodes(seriesid)
        next_episodes = []
        seriesinfo = self.get_series(seriesid)
        xbmc.log(msg="In get unaired episodes: " + str(seriesid) + " " + seriesinfo["title"], level=xbmc.LOGWARNING)

        if seriesinfo and seriesinfo.get("status", "") == "Continuing":
            highest_season = self.get_last_season_for_series(seriesid)

Note that in python the indentation should always be spaces and not tabs, and the indentation of the inserted log message has to match the lines above and below.   Failure to pay attention to this will cause a code error.  Python is fun but using whitespace to denote blocks is seriously f_d up.

The line wraps in the forum display.  Do not insert a new line in the code.

In the kodi log you will get something like this:

2022-12-17 13:39:24.256 T:17563 WARNING <general>: In get unaired episodes: 367506 The Lord of the Rings: The Rings of Power
2022-12-17 13:39:24.303 T:17563 WARNING <general>: In get unaired episodes: 365098 Inside Job
2022-12-17 13:39:24.372 T:17563 WARNING <general>: In get unaired episodes: 413215 Tulsa King
2022-12-17 13:39:24.476 T:17563 WARNING <general>: In get unaired episodes: 393192 Willow
2022-12-17 13:39:24.581 T:17563 WARNING <general>: In get unaired episodes: 368638 Miss Scarlet and the Duke
2022-12-17 13:39:24.690 T:17563 WARNING <general>: In get unaired episodes: 409508 Three Pines

The last show listed before the "airdatetime" error is the show with bad data.  The above log is just an example and there is nothing wrong with "Three Pines".

Instead of the above, you can always turn on Kodi debug logging, post the log and ask for help.

Another thing: the "Log Viewer for Kodi" addon has a web server which can be enabled in the addon's settings.   You can then view the log in realtime on another device while operating Kodi.   

Very convenient.
(2022-12-18, 00:01)mr.igor Wrote: [ -> ]Another thing: the "Log Viewer for Kodi" addon has a web server which can be enabled in the addon's settings.   You can then view the log in realtime on another device while operating Kodi.   

Very convenient.
What version of "TV Show Next Aired" are you using?
8.0.2 but also applies to previous versions
Just to clarify: Next Aired addon is not broken from what I can tell but it does not handle bad data well.  Actually, it is the addon for the TV db api which has the problem from my experience.  For me, the problems are always bad data except for 1.32 of the api addon which is broken.  1.31 is fine.  

Ideally a data burp from a single show should be logged and notification displayed but the code should continue to process other shows.  

eh, my 2c.   

I have been digging into it but the code and data are complex.   I have never used Python before so the curve to learn is a hard slog.  Also the api addon was written for V2 and I think the TV db is on V4.   Can't help.
I have tried all of your ideas and a few variations of my own using MQ8 MOD and get nothing.
Try using "script.embuary.info" it is not as robust but it works!
(2022-12-18, 20:14)melons2 Wrote: [ -> ]
I have tried all of your ideas and a few variations of my own using MQ8 MOD and get nothing.
Try using "script.embuary.info" it is not as robust but it works!

I haven't read your previous posts yet so forgive me if this is a rehash.   You should have Next Aired from MV's Beta repo (8.0.2) and the tvdb api v2 addon from github version 1.31 (the April 6 commit).  You can find it here:

TV db api v1.31

These should work on most skins although the look and feel will be off unless you edit the xml files.   I am using it withe Eminence skin with my own custom xml:


Do you have the log viewer addon installed?
@mr.igor . why you chamge skin xml...all working

time zone is problem for some user.


(2022-12-19, 00:53)Angelinas Wrote: [ -> ]@mr.igor . why you chamge skin xml...all working

time zone is problem for some user.
Well, kind of nice to make it match the skin, also I did this back when MV fixed the API code; at that point the next aired code was barely usable.  There were some things I didn't like about the artwork, and a fair amount of unnecessary stuff at least for me.  I like my code as lean as possible.

While you are here, the last commit to the tvdb api v2 (1.32) introduced a bug.  Someone else has added an issue for another package but the same error occurs with Next Aired.  Should be fixed or rolled back.
Thanks for your help.
How can I fix mine?
(2022-12-19, 14:47)melons2 Wrote: [ -> ]Thanks for your help.
How can I fix mine?


First off: I am a pure amateur and I have no in depth knowledge of Kodi, Python, or XML.  I also don't have a proper setup to code and troubleshoot.   I mostly do stuff on my phone and the Kodi amlogic tv box/remote control all of which is clumsy and painful to code and troubleshoot on.   I can point out some obvious stuff but after that I am out of my depth.

Next: as @Angelinas has said: it all works, so we need to some indication of what is going wrong.    Is the log viewer addon installed?   Best thing is to install it and enable the web log viewer.

If you have modified the Next Aired or TVdb addons, you should return them to their original states.   Easiest way is to uninstall them, then reinstall from the repo or github zip file.   Do NOT use the TVdb api V2 version 1.32.  It is borked.   use 1.31  

If you need help downloading an earlier commit from github, it is not difficult.

The only errors I have run into in the past year are due to bad data from the TV db.   The api addon does not deal gracefully with unexpected data and just quits; what you see is no response to running Next Aired.    I check the log, identify the bad data, then issue a bug report to the TV db.  In the meantime, I can remove the offending show temporarily from Kodi to get Next Aired working and verify a bad data problem.   The main external symptom for bad data is that Next Aired works, then it doesn't for a while, and then it inexplicably works again.     I have seen this maybe four times in the past year.

Mind you I have only my system to play with and who knows what problems may lurk in the swamp.  The python code and xml should be system independent but who knows?

The other thing is that a full rescan of data can take an hour or more.   If that has been initiated you may have to wait before you get a response.

I want to say thank you! After months and months, it works again!
I (re) followed your steps and reinstalled it and it works....thanks!

Good.  No reason why it shouldn't.  People like @Angelinas and all those who came before have put in a lot of work to keep it going; just because it isn't in the repo doesn't mean it is abandoned.