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

uh… I know I had some variant of 2.7 on my windows test host and I had to get pip…

pytz is the magic that gives me local datetimes…  I don’t want to include it, IMHO, Python (even 2.7) should have included it.

pip is just an easy way to pull in Python modules.  You can add them manually, but only if you know how to do that.

I just went to python.org and checked out about pip. Here is what I found out.


I hope this works. I highlighted the pertinent information in red.

Python 2.7.9

Release Date: 2014-12-10

Python 2.7.9 is a bugfix version for the Python 2.7 release series. Python 2.7.9 includes several significant changes unprecedented in a “bugfix” release:

  • The entirety of Python 3.4’s ssl module has been backported for Python 2.7.9. See PEP 466 for justification.
  • HTTPS certificate validation using the system’s certificate store is now enabled by default. See PEP 476 for details.
  • SSLv3 has been disabled by default in httplib and its reverse dependencies due to the POODLE attack.
  • The ensurepip module module has been backported, which provides the pip package manager in every Python 2.7 installation. See PEP 477.

The backslashes were returned with the error. I’m not sure where they’re coming from not something that I entered.

From stackoverflow -



672down voteaccepted

Python 2.7.9+ and 3.4+

Good news! Python 3.4 (released March 2014) and Python 2.7.9 (released December 2014) ship with Pip. This is the best feature of any Python release. It makes the community’s wealth of libraries accessible to everyone. Newbies are no longer excluded from using community libraries by the prohibitive difficulty of setup. In shipping with a package manager, Python joins Ruby, Nodejs, Haskell, Perl, Go–almost every other contemporary language with a majority open-source community. Thank you Python.

Of course, that doesn’t mean Python packaging is problem solved. The experience remains frustrating. I discuss this at Does python have a package/module management system?

And, alas for everyone using Python 2.7.8 or earlier (a sizable portion of the community). There’s no plan to ship Pip to you. Manual instructions follow.

@ShadowsPapa, good to know.  Pip is a nice tool.

@mb190e, I think something is wrong with the surlatablo file you downloaded.  It’s erroring on the first line… I think the file is corrupted.  It’s just a plain text file, should be able to browse to it and save as and then rename it.  Bring it up in and editor and you can verify that… but dont’ use a non-text editor (which is what you may have done??) because it might save it as something other than text.

LOL - don’t use notepad  ;-)

It can append stuff you don’t expect. 

I use Qwined and have not been let down.

I hope to try your little script tonight or tomorrow. Won’t my wife be thrilled if I can save a whole season of her favorite westerns and then use Windoze to burn them to DVD. 
She’ll give you and the Tablo support folks a hug if that ever becomes possible.
About the time they integrate a “file save” or export feature you’ll have her respect forever.
I had to buy a spool of DVDs a few years back so I could record every episode of Daniel Boone this oldies station played for a few months. Recorded them to DVD using our DVR/DVD recorder. 

Looks like this is possible with Tablo with just a little extra effort and maybe in the future, a native part of the system. 
Either way, I’m extremely hopeful seeing what a couple of the Tablo mega-power users have done here. 
It just doesn’t get much better.

@ShadowsPapa, I will have the new version up in about 5 hours or so… it will make doing whole TV seasons a lot easier (until I can enhance the query mechanism to do and/or, etc.)

@heffe2001, feel free to post here or send me a private message especially about videoredo… what are you using that for?

All comments, ideas, etc. welcome.

How does one tell if pytz actually installed. I tried using the egg file and it kept giving me syntax errors.


ffmpeg - where and what is that?

@ShadowsPapa, I’m a bit out of my juridiction.  Even when I do Windows, I do things probably in a different manner than most.  So… (this might help)… you can bring up Python interactively… from a cmd shell just invoke it via full path to the python executable and from there you can try to do “import pytz”… if that works then you have it…

I haven’t packaged up the new version quite yet, I may make some changes so that it sort of works without pytz.

Out of curiosity, does anybody have any idea how much trouble it would be to port/convert these Python scripts to PHP?

@ShadowsPapa  FFmpeg is a library and command line tool for manipulating video and audio files. https://www.ffmpeg.org/about.html  You might or might not have it installed already.

I couldn’t get the “import pytz” to work. But I changed directories to my pytz download and invoked setup.py install & that installed it for me. Now just waiting for the updated script… :slight_smile:


Thanks for your hard work cjcox…

EDIT: I just got the script to create the database successfully… I might just get this to work. Thank you for the clear instructions… :slight_smile:

New version that doesn’t require pytz almost ready… however, it’s probalistic only handles some of the gazilllion Americas timezones (focused mostly on Canadian ones, US should use US/Central, Eastern, Pacific, Mountain).  Doesn’t handle Newfoundland (on the half hour).  So… pytz if you can, but at least there’s something if not.

Just a few more minutes folks…

@Joltarin, I’m actually more of a PHP person… but I needed to learn Python.  Python is a JSON eating machine… I’m going to say it wouldn’t be terribly hard, but there would certainly be some pain required.

Version 0.2 released.

See CHANGELOG and get file from:

SurLaTablo

Oh… I recommend you remove your SURLATABLO_ROOT//*.json files and force an entire recache from the Tablo.  That’s so you can pick up the friendly_title metatype.

See my earlier post about why it might be useful.

I know a lot of  you are using it just to pull shows… this program started out as a way of knowing and querying what is on your Tablo.  Now with the advanced query format capability, feel free to share some nice query formats and outputs if you like.

In a future release, you’ll be able to specify format file templates.  And if you haven’t guessed, surlatablo.py will be used to create a web browseable interface to your Tablo data… and yes, I might just throw in a way to play the data straight off the Tablo… we’ll see.  Then you can do all sorts of normal things with regards to remote viewing of recorded data anyhow.

I guess I am officially stupid.


I can build the database.

I can query the database.

I cannot convert a file.

This is all I get:

W:\Tablo Convert>surlatablo.py --noupdate --query “Merry Madagascar” --convert
Working on:                             [./TV/Merry Madagascar/Season 0/Merry Ma
dagascar - s00e00 - Episode 0.mp4]
 Retrieving Tablo Data (62632):         [####################] 100%


W:\Tablo Convert>

It downloads the segments from the Tablo just fine & then stops. I am using the second version of the script. I am on Windows 7 64 bit…

Any help would be appreciated…

Thanks


@PhilH, redirect the output of the command to a file (>filename.txt)  then examine that and see if it tells you why it is failing.

Also, realize that at least on Windows, the progress bar wasn’t work (at least for me) for ffmpeg… so wait for it to return… and see if you get output (don’t interrupt it).  The finall 100% progress bar should print.