[WIP] Next-ep
#1
I have been working on a script that will display the what the next episode is for a given series.

I am doing this mainly as a learning experience as I'm still new to python, this is a standalone script and not to be run in xbmc. Once I am happy with the script I may try to add it to xbmc.

I have added a lot more features to my script than just next episode. So far there are two scripts one that deals with single shows and one that deals with multiple shows.

Here are the functions of each, so far:

Single show:

There are several ways you can create a show instance. There are 3 optional arguments. Name, Series id and search. Name and series id are pretty self explanatory, search is a boolean to be used in conjunction with name. If search is true which it is by default it will return a list of shows based on the name you gave. If its false it will select the first show in the search results.

Show all episodes: Does what it says, it prints a table with the season and episode numbers, the episode title and the air date. Separates the seasons into separate tables to make it easier to read. This has one optional argument call "spec" which by default is set to False, if set to true it will also display episodes that are listed as specials.

Show Season: This shows all the episodes in the season specified by the user.

Show Next Episode: This shows the next episode, based on todays date.

Show Upcoming Episodes: This will show the upcoming episodes, has one optional argument called "num". This controls how many episodes to see, its set to 100 as default, if you set it to 2, you will only see the next 2 upcoming episodes.

Show Latest Episode: This shows the latest episode.

Multi Show Script:

When you run the script it checks to see if a database of show names and show ids exists in the same directory as the script. If it doesn't it will ask you to enter the name of the show you want to add. This will search tvdb for the show and present results if there is more than one. It will then get the show id and add this to the database. It will continue to ask you to enter a show name until you enter no name, this is so you can easily add multiple shows when you first create your database.

Add Show: This is used to add new shows to your database by again searching tvdb for the show.

Delete Show: This is used to present the use with a list of current shows in order to select one to delete.

We have the same, Latest episodes, next episode and upcoming episodes as the single script, only this time it will do it for each show.

See Shows: Will present the user with a list of current shows in the database.

Show Episodes: Has one optional argument and that is the show name. If this is given it will search the database for that show and then show all the episodes for it. If its not given it will present the user with a list of shows to select from.

Show Seasons: This has two optional arguments, show name and season number, if these are given then it will display all the episodes for the given season in the show given. If not it will again present the user with a list of shows to select from and then ask them to select a season number, telling them how many seasons there are in that show.

Show Show Name: This is used to display a list of show names, these are different from show titles, show names are what the user used to create the show, these are used in the above functions optional argument show names.


I hope to post a copy of the scripts online later today, I'm a little hesitant to do so as I am very new to python so scripts are a little untidy.

I am just wondering are there any other features people would like, as I said I am doing this as a learning experience so don't expect miracles.

The only issue I have with the scripts at the moment, apart from them being untidy is the fact that each time the multishow script is run it redownloads the information for all the shows, thus making it a little slow at first. Reason I did it like this is that I wanted it to always have the latest information for the show, so I didn't want to save any of the information on a file, as then I would need to find a way to see if there have been any changes to the show and then update the file.

Thanks all for reading, please feel free to make any suggestions.
Reply
#2
Quote:I am doing this mainly as a learning experience as I'm still new to python, this is a standalone script and not to be run in xbmc. Once I am happy with the script I may try to add it to xbmc.

Just so I understand you correctly, do you mean that the results would not show up in XBMC? Or by saying "try to add it to XBMC" do you mean you wish to create a patch later for XBMC so it can be integrated? It's not totally clear to me, but that's propably just me Wink

In any case I am curious about your script as I would very much like this feature in XBMC one way or the other Smile

Asssuming the results would show up in XBMC what would be great is if somehow it can be visually made clear that the episode in question is not available yet. By appending some text to the title or something.

Good luck Smile
Reply
#3
Sorry I should have clarified.

As it stands the script will not display results in xbmc, the script will only print the results into the python interpreter.

Once I am happy with the script I may try and get the results to show up in xbmc, but I haven't looked into this yet so not sure how I would go about it.
Reply
#4
Here is a sample output from the script:

http://pastebin.com/YPw9HZRa
Reply
#5
Here is a copy of both script. Just extract them to where you want them, keep them in the same folder.

Script has only been tested on windows 7, its still missing some error checking and needs a little bit of cleaning up.

To run just double click on the menu script.

I am very new to python so be kind in your comments.

http://rapidshare.com/files/391003897/Nextep.rar

On a side note been thinking about how to try and get just the next episode side of things to work inside xbmc. It all depends on how people would want to see the next episode, would you want it to show up in the library after the latest episode. One way I thought of doing it would be to create a fake video file for the next episode and an nfo file to go with it.
Reply
#6
supertom44 Wrote:Sorry I should have clarified.

As it stands the script will not display results in xbmc, the script will only print the results into the python interpreter.

Once I am happy with the script I may try and get the results to show up in xbmc, but I haven't looked into this yet so not sure how I would go about it.

Thanks for clearing that up Smile

First off, I know nothing about python so I'm not in the position to give you technical feedback on it.
I just tried out the script though. Adding shows is working fine and after I was done it said database loading. Then the window closed. Is that supposed to happen? How do I go about listing the returned results?
Sorry if that's a stupid question Laugh
Reply
#7
supertom44 Wrote:On a side note been thinking about how to try and get just the next episode side of things to work inside xbmc. It all depends on how people would want to see the next episode, would you want it to show up in the library after the latest episode. One way I thought of doing it would be to create a fake video file for the next episode and an nfo file to go with it.


I think it would be great if it showed up in the library after the latest episode. But there would have to be some kind of visual indication that it's not actually available yet. I suppose a line in the nfo could take care of that.
Reply
#8
Im just working on a simple menu system now, that will stop it from closing, sorry about this its just due to the fact that I've been running it from within python.

Should be up in a few minutes, will be very simple text based menu.
Reply
#9
http://rapidshare.com/files/391003897/Nextep.rar

Ok here is a simple menu for the script, delete the old scripts and use these new ones had to make some slight adjustments to get the menu to work correctly.

Just double click on the menu, as long as there are all in the same folder should be fine.

Let me know.

Cheers.
Reply
#10
Jeroen Wrote:I think it would be great if it showed up in the library after the latest episode. But there would have to be some kind of visual indication that it's not actually available yet. I suppose a line in the nfo could take care of that.

How about having a small area on the skin, just a little text box that shows the information about the new episode.

I could write a script that adds the next episode info to the tvshow.nfo and the skin could get the info from there. That way it would be easily viewable in multiple places if you wanted plus you would not get it confused with another episode.

Is this possible?

I have no idea when it comes to skinning.

Also I could maybe write a script that uses the database to find out what shows are in the library and where they are located. The only issue would be first finding the database file as i dont imagine its in the same place on all machines. If its the same for each os, then I could maybe get it to find out what os is being used then look for the database based on that.
Reply
#11
you can check my plugin, like cdart downloader or wbmcstuff downloader (a little bit more messy) for db query and os distinction.
you can also check sportlive for display part.

I'm currently working on the same kind of script, integrated to xbmc, using Betaseries source info, i'm currently thinking about the way to display it in xbmc, i've got some try to do to decide what's the best way to do.
currently i can get next aired episode list , i can add a new tvshow from xbmc, i can handle a list of show in loading, store info locally (including banner serie) to not ask website all the time (info refresh every 10h).
Reply
#12
Cheers Ill check out some of your scripts, see how things should be done.

The database query I was playing around with last night and doesn't seem too bad.

Its all about how to display the info. Do you want it on a separate page that shows all the next episodes, or do you want it on the same page as the shows.

I personally like the idea of it showing up when I am viewing the latest season of that show. So I can see exactly when the next episode is coming up. Its just even then what is the best way to display it.

Can you make a pop up that only occurs when user is in a certain directory, so have a pop up with the next episode info for the show you are currently viewing. Either that or including it in the skin are the best options I have thought of so far.
Reply
#13
Hey supertom

I recently switched over from mediaportal, and they do have something like this integrated much like you are describing.

My suggestion would be to stay away from the idea of "fake" library entries or fake files -- it opens up the whole can of worms of what's considered 'watched', when do you filter future episodes, other plugins that operate on library items, etcetera. I'm a little concerned about repercussions for searching as well. I'm afraid I don't know xbmc well enough to be more specific, and really maybe Im just out in left field and imagining the worst, I don't know.

Certainly the most convenient way from the user perspective, is to see those future episodes (or, episodes that you do not actually possess that are in the past) in the library view. But that kind of assumes that the concept is going to work logically throughout XBMC and be tightly integrated. (Seems complicated to me).

Probably an easier way to implement would be to simply add something like a "Next episode: (date) (title)" , and possibly be able to click it for the full season schedule. ? But I'm really just guessing.

Personally I'd really love "Ended" and "Last aired:" info in the banners list, but thats just me.

However you decide to implement I can guarantee its going to be 10 x better than having to exit xbmc and log into tv.com Smile

thanks for your efforts
Reply
#14
Thanks for the comments.

I agree the fake file would be a bad idea.

One simple way of doing it would be to just create the script so it runs in xmbc, so you go to scripts and then run the script. But its still not an idea solution as I'd prefer it to be displayed when viewing the library.

I think I might look into adding a box in the skin tomorrow, might post it in the skinning section as I have no idea how to do this.
Reply
#15
Might have a play around with storing the xml files on the users hdd and then just checking tvdb to see if there have been any updates.

Didnt really want to store the files locally, but will make the script much quicker, and there only small files.

The displaying in xbmc is beyond my skill level at the moment I'm afraid, I might wait and see how ppic decides to integrate it.
Reply

Logout Mark Read Team Forum Stats Members Help
[WIP] Next-ep0