Introducing: Plex Channel for TabloTV

https://github.com/davidjvr/TabloTV-Plex-Channel/archive/master.zip

here is steps in terminal on mac to install Tablo.bundle unziped folder into plex server on an asustor NAS but it may work same with any nas

providing you unziped and place folder in download folder on the NAS

you need to root ssh in NAS because file explorer app on nas hides plex folder

download the tablo bundle from link https://github.com/davidjvr/TabloTV-Plex-Channel/archive/master.zip

unzip it and upload entire Tablo.bundle folder to your nas in the default download folder

on mac open terminal and…

ssh root@fill in your asustors ip address

your mac admin password

cd /volume1

cd Download

cp -r Tablo.bundle/ /volume1/Plex/Library/Plex\ Media\ Server/Plug-ins/

close terminal restart plex or restart Asustor NAS 

then open plex from the app in NAS

goto channel>install channel>more>install channel>click on tablo thumb and install

done your all set

enjoy! video incoming on my youtube channel

https://www.youtube.com/user/DAVE01568


Anyone have this successfully running on sinology plex?

@Davidvr, here is what I am seeing in the Plex Log:


Jul 18, 2014 09:47:19 [0x10d104000] DEBUG - HTTP requesting to: http://127.0.0.1:62283/video/Tablo/livetvnew?title=Live+TV
Jul 18, 2014 09:47:19 [0x10d104000] DEBUG - [com.plexapp.plugins.tablo] HTTP reply status 304, with 0 bytes of content.
Jul 18, 2014 09:47:41 [0x10b904000] DEBUG - EventServer: Connecting to pubsub.plex.tv

Returning 304 with 0 bytes???

Edited : I ended up adding a        Dict.Save() at the end of   if unixtimeaproxend > unixtimenow:
              
And when I ran it again without removing files it worked. But weird that it would work without that anyway. But I will keep you posted

@Jestep That is very interesting about the Dict.Save()  , it could be a bug in plex itself but I’ll add that into the code on my end. As far as logs, that looks like the plex log not the plugin log. Check the ones under Plex Plugin Logs and there should be ones that start with Tablo that will have any plugin related errors. 

@Davidvr, I moved it to outside the loop, otherwise it would save for every item.


Also, I would hold off and see if it actually updates correctly after tomorrow after a long night of sleeping computer :wink:

And I agree, it should not be required, but tried it anyway :wink:

@tacopeland yes - installed it the other day on our DS1512+.  Haven’t looked at it much but so far it works great.

We are now in the official channel store , it is not as up to date as the GitHub site but we will update the offical copy as we confirm the Lastest changes are fully tested.

@Davidvr, ok it was a bit more complicated than I previously had said.

I started really digging into the logs and logging start times and end times a bit different so I could look closely

So First, in loadLiveTVData

 if unixtimeaproxend > unixtimenow: should be if unixtimenow > unixtimeaproxend:

Because you want to reload if the current time is greater than the end time of the show . Interesting because how did it work before? Well, If the show is set to end at 8:30am > current time 7:00am things were loading correctly. But we should be looking at the current time being greater than the end time of the program to reload the data.

That is the easy part.
The harder part to figure out is:
The times in Tablo are stored in UTC format so when you get the local time you have to convert it to UTC for the local time

from datetime import datetime, timedelta
import time
**************************************************
unixtimenow = Datetime.TimestampFromDatetime(datetime.utcnow())  

You also have to take into consideration Daylight Savings time 
            unixtimestarted = Datetime.TimestampFromDatetime(Datetime.ParseDate(Dict["LiveTV"][chid]['airDate']) - timedelta(hours=time.daylight))

Oh, and I also was able to remove Dict.Save() since this fixed the issues. 

Once I did this things started working correctly. Even worked after a good nights computer sleep.

So why did it work before???

if unixtimeaproxend > unixtimenow: UTC end time for a show playing right now (In my time zone Pacific, I am in California) is always currently 7 hours (Local TIme) behind UTC. So all day when I was testing things worked.
But when I sleep over 7 hours, end time is less than my current time.


@Jestep nice catch but I’ll double check on my end and merge it in

@jestep I’m not at home right now to test but since I am comparing in unix time stamps I don’t think dst is a factor

@Davidvr DST is a factor, I saw it on my system. And the time you were getting for current time was not UTC rather Local time


It was off by an hour

Also, make it                 if unixtimenow >= unixtimeaproxend:

So that way it refreshes a minute before

I have had no issues what so ever since making those changes

@jestep
Both .now and .utcnow produce the same timestamp on my system. Can you confirm your seeing different behavior

@jestep
Both .now and .utcnow produce the same timestamp on my system. Can you confirm your seeing different behavior

I can, I saw it last night in my testing. I wrote out the current time in an easier to read format and the time was off by an hour from the UTC time in the Tablo datetimes. What Time Zone are you in?? I am in PST


Maybe in your area DST is 0 whereas mine is 1??

@jestep in in CST maybe it’s os specific behavior, im on os x

@Davidvr, so am I :wink: Some states do not observe DST, Does yours?


Create a quick python script with

from datetime import datetime

import time

print time.daylight


See what the value is

Edit: Should have said mine returns 1 for that

@Jestep I’m going to PM , I’d rather keep development work off of this thread

@Davidvr, not a problem :wink:

Thanks to @Jestep for helping resolve some live tv issues. A new build is up if everyone wants to check it out. 

@Davidvr and @PiX64,


I thought I posted a big congrats to you guys, but don’t see it. So…

NICE JOB!!! Your TabloTV Plex channel is awesome! This opens Tablo up to devices even the Tablo group isn’t currently supporting. I can watch live or recorded TV on my iPhone and on my AppleTV now. Using the channel is a seamless experience. I am a programmer by trade and would love to help you, but when I looked at the code base on GitHub I realized it was Python, not my forte. If there is any other way I can help let me know.

Shawn