SurLaTablo.py - Python program to query and convert Tablo recordings

@cjcox I haven’t seen any public API for tablo or would’ve given it a shot. The external access seems to be read-only.


-Vishal

You are not looking hard enough.

@cjcox So the script has been running great from a cronjob on my Plex server - but every once in a while, shows that are on the Tablo do not transfer over.  When I run the script manually from the command line, and look at the output text - it doesn’t list the new show at all.  If I delete the SurLaTablo directory, and run the script again it picks up the new show.  Any ideas?  There are no error messages or anything to report, it all works fine, just doesn’t add the new shows to the database, and of course doesn’t transfer them.


– Ryan

@Gosmitty, Hmmm… I suppose there could be a bug in there… but apart from a bug, the design is sound, in other words, it should never miss.

A more likely cause is that Tablo’s metadata about the status of a recording can be wrong… so that surlatablo believes there is a show that is in a BUSY/RECORDING state, when it’s really not.  While in that state, the data will never get added to the cache db.  There is a flag in surlatabo.py to force add everything in such a state (not recommended if there really is a show that is supposed to be the RECORDING/BUSY state).  So… if you’re sure nothing is really happening on the Tablo, you can try doing a run with the -B option to force those records into the cache.   If there are shows “stuck” surlatablo.py (normal default no options) will keep showing those shows as being in the RECORDING/BUSY state… which is sort of hard to miss if watching the program interactively, but could easily be missed if being run in batch.

With all that said, the Tablo’s bad state info doesn’t go away (a clean out of the surlatablo cache can’t fix something stuck on the Tablo) and there’s no way to make it go away.  I usually use the -B option, pull the file off the Tablo and then delete the show… (which of course gets rid of the bad metadata state on the Tablo).

So… maybe this helps, or maybe there’s a real bug… I might not be able to find/fix it until it happens to me though.



Preview of 1.0 (it’s about time!) changes and features.

1.0 -
   1. Fixed a bug in article detection for sort_title (thanks @alexbunk).
   2. Added options[‘truncate’] to allow clipping off some seconds from end
      of show.  Many people might set options[‘truncate’] = 300 in their
      surlatablo.conf file (truncate last 5 minutes).
   3. Add fix to commercial zap code that might prevent an infinite loop.
   4. Added timers so you can see how long steps take.
   5. Added Mp4z trancode option that is relatively fast, but a full
      transcode.  Useful when using -z to zap commercials (gets rid of
      the audio/video out of sync problem for zapped shows at a bit of a
      performance and quality hit).

@cjcox Thanks for your hard work. I use your script daily to move shows off of Tablo and into Plex.

Please help a noob!


Been running Plex/SABNzbd/Sickbeard for years, and am really anxious at getting shows off of Tablo in mp4 format with commecials stripped.  Trying to wean off my usenet dependency if you know what I mean.

Not really good with Python, but am enthusiastic to learn.  Installed Python on Windows, downloaded the script and made my changes and successfully created the cache db.  Getting the following error when running the command below:

c:\Python27\Scripts>python surlatablo.py --noupdate --query Blacklist\
Traceback (most recent call last):
  File “surlatablo.py”, line 2583, in
    if (re.search(search_pat, record_s)):
  File “c:\Python27\lib\re.py”, line 146, in search
    return _compile(pattern, flags).search(string)
  File “c:\Python27\lib\re.py”, line 251, in _compile
    raise error, v # invalid expression
sre_constants.error: bogus escape (end of line)

Can someone help a noob here?




Get rid of the backslash at the end of your query.

Geez… I’m embarrassed.  Works!   Thank you!


@cjcox - I think I found what was wrong.  I ended up with TWO cronjobs firing the script at the same exact time, and I think this may have been causing my issue.  So I fixed it, and we will see if things start working without the random failures.


– Ryan

SurLaTablo 1.0 released

There’s also a Windows installation vid

Friggin’ awesome.   Spend time extracting a few series last night, works great!  I really appreciate your efforts on this.


I’d still love to know how “they” are able to flawlessly remove commercials when posting episodic TV shows to usenet.  I tried Comskip (via MCEBuddy) on output files from your script and it’s not bad - just takes a long time (an hour and a half for a one-hour episode!) and occasionally misses a few commercials.  


@Flatulaor, I do have another commercial skip algorithm that is simpler, but both have flaws and make plenty of mistakes without lots of tweaking (no universal setting seems to do well for all things).  My plan is to create a tool that forces interactivity, much like MCEBuddy can, that will allow you (the human) determine what “stays” and what “goes”.  But likely that tool will somehow be standalone and work on any video source… (sigh too many ideas, and not nearly enough time).

My commercial zapper (-z) works much faster than your experience with MCEBuddy, but probably makes more mistakes.


@cjcox if you make said tool for editing a video file and chopping out segments…I would pay money for that.


The interface that MythTV used for editing a cut list was pretty slick, but you had to have a dedicated front end machine and it had to be Linux based.  I’d like to see something maybe Java or Python based that would work on “any” platform.

it’s the “interactive” part that makes things difficult interesting.  My guess is that the interface will be web based and you’d select a local file to work on.  It would (simulate) breaking apart, generate some images or animated gifs at begin and end of simulated segments, present those to the end user and via selection buttons, you’d choose what segments stay and what ones go, then the final real extractions are done, and stitched together (via a transcode, see problem with audio/video sync for why this is necessary).

Nice part is that the tool could be run on anything… not just SurLaTablo data.

There would still be some error, but much less so (it might be a 90%+ solution).


Oh and  @lurker, I’ll gladly take any donations of the monetary variety :slight_smile:

But in general I give my best things away for free… just how I roll…


~X(

Is there a complete guide (easy to follow) for setting this up?  I have a new Qnap TS-451 media server and I can install a Linux VM on it.  Presuming this is the OS of choice, so I am willing to try to do this, but it would be nice to have something to follow along with.  


I am reading along some threads on this, but it kind of seems there is more to this than I am following.  It might soak in, but thought I ask if helps were availible or in the works.

Thanks.

-Rodger

A TS-451 is fairly low end (but still a Celeron though), however, if you can afford to run a Linux VM on it, Python 2.x is likely included with whatever distribution you have, then you need to obtain (avail for many distros) or compile ffmpeg and ccextractor (optional).   Unlike Windows, it should be fairly painless with Linux.

If you’ve done just about anything with Linux, there should be no surprises.

1. Python
2. ffmpeg
3. (opt) ccextractor

Install those 3 things, likely the first two will be through your distribution’s repos, the last one just Google and install it from there.



Thanks, I’ll give it a shot.  Use to own a computer shop, so I have a few “left overs” I could use one explicitly for this if needs be.


-Rodger

You don’t need a Linux VM.  Installing Python and FFMPEG on a Windows machine is a trivial exercise and this script works perfectly on that platform.


I have an older QNAP TS-469L and was not able to get the Python and FFMPEG versions up to what was needed, so gave up on that and just installed on one of my Windows PCs.