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

Is there an easy way to simply run this script and grab all new records move them to a folder and convert them (possibly deleting the old ones)? I can’t seem to find how to do this without calling out each recordingid explicitly? sorry if I’m missing the obvious, thanks in advance!

Hey @cjcox, I have a small issue I am hoping you can help me with related to commercial removal. I fully understand it’s a black box, just wondering why this is occuring as I can’t figure it out. Basically, no matter what show I try to extract from Tablo and remove commercials from I always end up with a 0 (zero) size file in the end. Below is a capture from a test run I did against an episode of 48 Hours.

[root@tablorip_1 ~]# /media/surlatablo/bin/surlatablo.test.py --convert --zapcommercials --query series~=“48 Hours” Mp4z
Working on: [/media/test/48 Hours/Season 27/S27E26.720p.HDTV]
Retrieving Tablo Data (279044): [####################] 100% Elapsed seconds 210.0
Searching for commercials: [####################] 100% Elapsed seconds 269.0
Removing commercials (z1): [####################] 100% Elapsed seconds 53.0
Elapsed seconds 0.0

[root@tablorip_1 ~]# ls
.bash_history .history .login .ssh tablorip.bak
.cshrc .k5login .profile tablorip tablorip.new
[root@tablorip_1 ~]# cd /media/
[root@tablorip_1 /media]# ls
surlatablo test tvshows
[root@tablorip_1 /media]# cd test
[root@tablorip_1 /media/test]# ls
48 Hours
[root@tablorip_1 /media/test]# cd *
[root@tablorip_1 /media/test/48 Hours]# ls
Season 27
[root@tablorip_1 /media/test/48 Hours]# cd *
[root@tablorip_1 /media/test/48 Hours/Season 27]# ls
S27E26.720p.HDTV-z.mp4
-rw-r–r-- 1 root wheel 0 Jul 20 11:20 S27E26.720p.HDTV-z.mp4
[root@tablorip_1 /media/test/48 Hours/Season 27]#

Any ideas?

Thanks for your script and assistance.

Redirect the output of the surlatablo to a file… that sort of turns on some debugging… it might help determine what went wrong. It’s like it crashed on Mp4z, calling up the transcoder. Could well be a bug… but that output might help me out in finding/fixing it.

oh… and surlatablo is anything but a “black box”. Full source… nothing hidden.

Didn’t mean anything by the black box comment. I as referring to the commercial skipping and other comments you have made. Black box should have been Black Art. My bad for the typo.

Got the output file, how best to get it to you? Post it here or ?

You can use this site to send me a private message if you like.

Ahhh… it is a blackbox^H^H^Hart indeed.

Surlatablo won’t overwrite files it already sees. Thus if you’re sending files to the paths, it will skip anything that already is out there (if it’s bad or wrong and you want it to do it again, one way to force that would be to remove the errant output file).

To query for any character you could:

surlatablo.py -q .

Thus to query all that is on your Tablo and convert:

surlatablo.py -q . -c

Again, it will rapidly skip over files that are already present.

Avoid using the -y parameter as that tells surlatablo for force overwrite the output. But -y can be useful for more specific queries of course if you need to redo a pull/transcode.

PM sent.

Posting this here too as others might have the same problem…

The aac on your ffmpeg requires this option (or -strict experimental can be used)

so… you could edit the source code of surlatablo.py and in the TRANSCODER_OPTS extend the audiooptions array to add ‘-strict’, ‘experimental’.

'audiooptions': [ '-metadata:s:a:0', 'language=${lang3}', '-strict', 'experimental' ],

You want to do this for any Mp4 variant transcoder.

The alternative would be to extend and/or override with your own TRANSCODER_OPTS[‘myMp4’]= etc… in your surlatablo.conf file. It’s weird because at the end of 2015 ffmpeg said you no longer would need -strict experimental… and now perhaps it’s needed again (?) I know my ffmpeg doesn’t need it, but can’t say for sure what aac encoder I’m using at the moment by default on my ffmpeg.

oh… and I didn’t test this… :slight_smile:

Because of the way I’m handling options, option values need to be strings, e.g.:

options['no_utf8_names'] = 'true'
options['postscript'] = 'true'

That fixed it.

All is working now. Thanks!

SurLaTablo 1.9p1 Released

1.9p1

Minor patch to fix some potential unicode character issues.

SuLaTablo is broken with the latest beta release. It appears the internal URLs have changed.

home:~ miniserver$ /usr/local/bin/lockrun --verbose --lockfile=/var/tmp/surlatablo.lockrun -- /usr/local/bin/runsurlatablo
Waiting for process 1691
Traceback (most recent call last):
  File "/usr/local/bin/surlatablo.py", line 2486, in <module>
    jch_ids = urllib2.urlopen(ch_ids_url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 437, in open
    response = meth(req, response)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 550, in http_response
    'http', request, response, code, msg, hdrs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 475, in error
    return self._call_chain(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 558, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
pid 1691 exited with status 256 (time=1 sec)
Exiting rc=1

Beta 5 dropped support for the old API…

Yeah, I remember seeing you mention something about that. So there’s no longer any HTTP access? Or is it just different now?

The current API still uses HTTP, but you need to sign up as a developer to get at the docs.

I’m not trying to hijack this thread from @cjcox. Just thought I’d share the news and move along. I’m sure he’ll weigh in.

Somewhat true… you have to sign a very restrictive NDA that prohibits open source development. It could be the end of the road for me… sigh…