Kodi Community Forum
[RELEASE] PseudoTV Addon: Virtual EPG and TV Channel Surfing Script - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+----- Forum: PseudoTV / PseudoTV Live (https://forum.kodi.tv/forumdisplay.php?fid=231)
+----- Thread: [RELEASE] PseudoTV Addon: Virtual EPG and TV Channel Surfing Script (/showthread.php?tid=90738)



- jtucker1972 - 2011-02-08

For those interested, I uploaded the first version of the PseudoTV_Channel_Kit. Go to http://tiny.cc/xbmcplaylists. There is a sample channel in the kit for reference. Unzip the file to your video playlists directory.

If you don't want to download all 295 playlists, then go to the library subfolder and download the ones you want cafeteria style.

I find that it is actually easier to just modify the channel playlists by hand versus using the Smart Playlist Editor in XBMC. FYI, If you use the Smart Playlist Editor, you will have to manually move the mixed playlists from the mixed folder to the video folder after you have saved them.

Here's a sample mixed channel to get you going.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="mixed">
    <name>Sample Channel</name>
    <match>one</match>
    <rule field="playlist" operator="is">get-10-action-and-adventure-episodes.xsp</rule>
    <rule field="playlist" operator="is">get-action-movie.xsp</rule>
    <rule field="playlist" operator="is">get-adventure-movie.xsp</rule>
    <rule field="playlist" operator="is">get-10-action-and-adventure-episodes.xsp</rule>
    <rule field="playlist" operator="is">get-action-movie.xsp</rule>
    <rule field="playlist" operator="is">get-adventure-movie.xsp</rule>
</smartplaylist>

I tried to name the playlists so that they would be self identifying. The above playlist will build the following:

Get 10 action and adventure episodes
Get 1 action movie
Get 1 adventure movie
Get 10 action and adventure episodes
Get 1 action movie
Get 1 adventure movie

So the final playlist has 24 video files in that order (it will if Jason adds my code to the official version).

You can mix and match playlists however you want. You just need to add/replace the playlists in my sample. There are no limits to the number of playlists you can add.

Here's an example of a mixed movie playlist.

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="mixed">
    <name>Movie Mix</name>
    <match>one</match>
    <rule field="playlist" operator="is">get-action-movie.xsp</rule>
    <rule field="playlist" operator="is">get-adventure-movie.xsp</rule>
    <rule field="playlist" operator="is">get-drama-movie.xsp</rule>
    <rule field="playlist" operator="is">get-comedy-movie.xsp</rule>
    <rule field="playlist" operator="is">get-western-movie.xsp</rule>
    <rule field="playlist" operator="is">get-biography-movie.xsp</rule>
    <rule field="playlist" operator="is">get-sport-movie.xsp</rule>
    <rule field="playlist" operator="is">get-musical-movie.xsp</rule>
    <rule field="playlist" operator="is">get-mystery-movie.xsp</rule>
    <rule field="playlist" operator="is">get-sci-fi-movie.xsp</rule>
</smartplaylist>

If you want to randomize the playlist, then just add the <order> to the playlist (see below)

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<smartplaylist type="mixed">
    <name>Movie Mix</name>
    <match>one</match>
    <rule field="playlist" operator="is">get-action-movie.xsp</rule>
    <rule field="playlist" operator="is">get-adventure-movie.xsp</rule>
    <rule field="playlist" operator="is">get-drama-movie.xsp</rule>
    <rule field="playlist" operator="is">get-comedy-movie.xsp</rule>
    <rule field="playlist" operator="is">get-western-movie.xsp</rule>
    <rule field="playlist" operator="is">get-biography-movie.xsp</rule>
    <rule field="playlist" operator="is">get-sport-movie.xsp</rule>
    <rule field="playlist" operator="is">get-musical-movie.xsp</rule>
    <rule field="playlist" operator="is">get-mystery-movie.xsp</rule>
    <rule field="playlist" operator="is">get-sci-fi-movie.xsp</rule>
[b]    <order direction="ascending">random</order>
[/b]</smartplaylist>

Things I am still thinking through:

Serial TV Shows - I've added a list of tvshows which are of a serial nature, e.g. 24, lost, fringe, etc. These shows tend to need to be watched in sequence. I'm thinking of creating a get-tvshow-serials playlist to get a list of these so I can exclude them from the get-episodes playlists if so desired. I would have a seperate set of get-episodes playlists for this option.

You can use the get-tvshows-showname-episodes to create a marathon showing of a show like they do on syfy channel from time to time.

Open to hearing other thoughts and ideas. I've tried to make this as simple to use but at the same time very flexible and powerful for controlling the programming of your channels.

Also, if you want to use my updated version of the build mixed playlist functionality, you can download it from the resources folder. All you have to do is copy the Overlay.py to your ~\AppData\Roaming\XBMC\addons\script.PseudoTV\resources\lib folder.


- Jason102 - 2011-02-08

Mixed playlists will be discovered if they are in the "mixed" directory...they don't need to be moved to "video".


- jtucker1972 - 2011-02-08

Then you just have to keep track of which channels you have in each folder. Good to know.


- branlr - 2011-02-09

jtucker1972 Wrote:I think this is do to how your playlist is constructed. If you have a show with 100 episodes and a show with 10 episodes, then the law of averages would pick 10 episodes of the first show for every 1 episode of the second show. You need to create a playlist for each show and limit it to the same number of episodes. This evens the odds that one show will be picked as another.

I use genres for my Channel Packs. I have a large collection so my shows rarely repeat. If you have limited shows than this can skew one show over others.

I would be curious to know what your rules are for the playlist.

Unfortunately, this can't be the case. For example, I have an Animation category-- I have MANY cartoons in my collection, and when I look at the animation genre in xbmc there are many many shows in there--yet it will show batman the animated series for 2 days straight (awesome! but not not all the time lol) followed by 2 days of futurama... not laws of averages, though I certainly get your reasoning.....

my playlists look like this...

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<smartplaylist type="tvshows">

<name>Children TV</name>

<match>all</match>

<rule field="genre" operator="is">Children</rule>

<limit>100</limit>

<order direction="ascending">random</order>

</smartplaylist>

Any thoughts?


- MrLuddite - 2011-02-09

I grabbed the Channel Kit that jtucker1972 posted earlier and have been giving it a try. I'm new to XBMC and have been trying to figure it all out. Thank you jtucker1972 for the work that you have done with these. I have a question about the single show playlists that you included. Is it possible for the playlist to list the season/episode number in the info pane along side the show title? I've tried my hand at figuring out smart playlists, with little success. Is this something simple that can be done in the playlist? Thanks to you guys for creating a cool new way for us to interact with our media!


- TheDoughboy - 2011-02-09

I tried out this script and love but I'm having the same issues branlr is having.

I downloaded the channel pack and after working through a ton of duration errors I had it up and running (50 channels) with 2 or 3 episodes/movies a channel repeating themselves over and over endlessly. I then decided to troubleshoot by removing all but one channel, no luck. I then deleted the cache and settings files, still no luck. What's weird is I go back into the playlists and bring the channels up and I have a lot of random episodes/movies more then I see in PsuedoTV.

I can't wait for the issues to be worked out because I can see this script being defacto in my household for a lot of tv nights. I'm actually going to try and see if I can add some features to it. I always wanted a plugin where I could re-create tv programming blocks I grew up with (like TGIF and Saturday Mornings on CBS) this is exaclty the script that could do something like that. Plus I would love to see streaming get integrated. I use WMC to record some shows and they have streaming channels built into the EPG, it would be great to wrap streams like that into this script.

Anyways just wanted to chime in, great script keep up the great work.


- Sranshaft - 2011-02-09

MrLuddite Wrote:I grabbed the Channel Kit that jtucker1972 posted earlier and have been giving it a try. I'm new to XBMC and have been trying to figure it all out. Thank you jtucker1972 for the work that you have done with these. I have a question about the single show playlists that you included. Is it possible for the playlist to list the season/episode number in the info pane along side the show title? I've tried my hand at figuring out smart playlists, with little success. Is this something simple that can be done in the playlist? Thanks to you guys for creating a cool new way for us to interact with our media!

Currently, no. This is something that needs to be added to the core of PseudoTV and has nothing to do with the smart playlists. I believe it is on Jason's to-do list once things are stable but he'll have to confirm this for you.


- MrLuddite - 2011-02-09

Thanks Sranshaft for the info! Having the season/episode info visible while you scan the show in the guide would be very helpful, especially since I have several tv series that I have just recently started to watch for the first time from the beginning. Several of these shows have at least 3-5 seasons already, and it's kind of hard to locate where I left off, and reading the episode summary can sometimes reveal spoilers that I don't want to know!


- MrLuddite - 2011-02-09

Hello Jason102, thanks for all of your hard work to date on cooking this up for us to enjoy, I can't wait for it to be finished! I'm not sure if this is on your to do list already or not, but is it possible to flag an episode as being watched? Maybe greying out the listing for that episode or a check box or something? That would help if it happened automatically after the guide detects that the episode has been played through? This feature would be especially great in conjunction with "get-tvshow-XXXXXX-episodes" style playlists like jtucker1972 created in his Channel Kits. This would be most useful for entire seasons of shows that are set up to play in order. Also the ability to manually "grey out" or "check off" an episode as being watched would be great too. I'm not sure if either of these options are doable in this script, but if they are it would be great to have.


- Jason102 - 2011-02-09

I'm currently looking into some possibilities for speeding up the start time, as well as providing the skin with additional show information (season, episode, watched, logo, etc.). Hopefully I can figure out some trick to making these work.

For those not getting all of the shows to appear in PseudoTV, I actually have XBMC process the smart playlist and I take the results. The only difference comes out of the fact that I need to know the duration of any items I take...if a show doesn't have a known duration then I skip it and it won't be played. The first step is to make sure the durations are know (search this thread for a couple different methods). After that, have XBMC load the playlist. Presuming the shows have durations, the smart playlist results in XBMC should match those in PseudoTV.


- TheDoughboy - 2011-02-09

I wanted to add after a lot of research the movie issue appears, for me at least, to be coming from older scrapes using the <runtime> tag. I use Ember for movies and found I had the get runtime tag on. It was adding weird information to the tag that both XBMC and Psuedo were trying to read and couldn't. I'm in the process of cleaning it all up. Just another tip if anyone else has the issue, put the duration/runtime in min and only min. Some of my movies had mins and I changed those to min.


- jtucker1972 - 2011-02-09

To everyone playing with the channel setups. Make sure you go into the PseudoTV Settings and check the "Force all channels to be reset" box. If not, then PseudoTV will keep loading the previous m3u file for the channel and you will not see any changes.

If you go to ~\AppData\Roaming\XBMC\userdata\addon_data\script.PseudoTV\cache you can see the output. There you will see channel_1.m3u, etc. This is what actually gets shown in the channels.

For those trying to get their channels setup, please PM me and I will help troubleshoot. Personally, I would rather have Jason focused on getting the wish list items added. :-)


- jtucker1972 - 2011-02-09

branlr Wrote:Unfortunately, this can't be the case. For example, I have an Animation category-- I have MANY cartoons in my collection, and when I look at the animation genre in xbmc there are many many shows in there--yet it will show batman the animated series for 2 days straight (awesome! but not not all the time lol) followed by 2 days of futurama... not laws of averages, though I certainly get your reasoning.....

my playlists look like this...

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

<smartplaylist type="tvshows">

<name>Children TV</name>

<match>all</match>

<rule field="genre" operator="is">Children</rule>

<limit>100</limit>

<order direction="ascending">random</order>

</smartplaylist>

Any thoughts?


It seems the default behaviour of the XBMC playlist is to force a sort order, so the shows after being randomized are being sorted which is causing the issue.

Now, if you create a mixed playlist and add the get-100-children-episodes.xsp from my PseudoTV-Channel-Kit, and set the order to random, then Jason's script should truly randomize the shows. In Jason't current code, it should randomize the mixed playlist by default.

I think I am going to have all my channels as mixed playlists.


- jtucker1972 - 2011-02-09

I'm doing more digging on this issue of playlist randomization. The actual sql code that the playlist creates is working fine. Below is a sample for the get-100-children-episodes.xsd

select * from episodeview WHERE (idShow in (select idShow from genrelinktvshow join genre on genre.idGenre=genrelinktvshow.idGenre where genre.strGenre LIKE 'Children')) ORDER BY RANDOM() LIMIT 100

Using SQlite Browser, I executed the above SQL and it returned random episode ids. There were still back to back of the same shows, but the episodes were random seasons and episodes.

However, when you view the playlist in XBMC, the shows are sorted by the strFilename it looks like. So there seems to be something else happening after the SQL results are returned and they are displayed in the playlist window.


- jtucker1972 - 2011-02-09

TheDoughboy Wrote:I wanted to add after a lot of research the movie issue appears, for me at least, to be coming from older scrapes using the <runtime> tag. I use Ember for movies and found I had the get runtime tag on. It was adding weird information to the tag that both XBMC and Psuedo were trying to read and couldn't. I'm in the process of cleaning it all up. Just another tip if anyone else has the issue, put the duration/runtime in min and only min. Some of my movies had mins and I changed those to min.

Same here. Ember really screwed up my movie library. Weird thing is that runtime is set to min for most. Sometime you get 141 min | 160 min (premiere cut). But since I've scrapped my movies with Ember, XBMC no longer updates the streamdetails table which is where PseudoTV gets the durations from. So I get the No duration error when trying to load the channel. I even tried the playlist trick but it would just sit there and not update the durations.

I unchecked Runtime from the Scraper Fields - Global settings. I am re-scraping now to see if that fixes things. We shall see. Fun times.

Image