API/interface to pull recorded show listings, metadata, and files off of the Tablo

Is it possible to modify the script so that it writes to a temporary filename (like {build}.tmp) and then renames it once completed? I have other scripts regularly monitoring the contents of the target directory for “.ts” and “.mp4” files and I don’t want them attempting to grab the files before they have finished downloading.

Thanks!

With the new api, I don’t see the individual segment files like I did in the old version (I used to grab each of the files individually and rebuild them). With the new api I use ffmpeg to download the file via the available playlist. So no more .ts files, which has it build the final file directly. I’d recommend having your script look for the .mp4 files.

I’ve never noticed this behavior, it should try to download the file on the next run if the file has completed recording… I will have to try to recreate this.

My script is already configured to grab the mp4 files - the problem is it is trying to grab a partial file before tablo2go has had a chance to completely download it.

On another note - I know this is probably asking a lot, but would it be possible to manually provide the Tablo’s private IP address? My tablo2go box is running behind a VPN so the public IP is different from that of the Tablo (which is not behind this VPN…) and although there is a working internal route between the two, the automated private IP detection doesn’t work properly in my case :frowning:

I’ve been trying to hack a solution together myself, but my python skills are pretty weak (old school shell and perl)…

The easiest way to manually tell the system the ipaddresses, would be to change the lines:

for tablo in found_tablos:
TABLO_IP = tablo[‘private_ip’]

to:

tablo = {}
for TABLO_IP in [‘192.168.2.1’]:

if you have more than one, do something like:

tablo = {}
for TABLO_IP in [‘192.168.2.1’,‘192.168.2.2’]:

1 Like

Perfect, thank you!

I’m seeing the exact same behavior that ultramookie described:

Run tablo2go-3.08.py while a show is actively being recorded
The show’s metadata will be loaded (I see it in the tablo3.mtd file)
When show has completed recording (or stopped early), run tablo2go-3.08.py again
The script cannot see (or download) the show that was actively being recorded, but is now done

It appears that the code checks for recording status. If it is not finished it should skip. Here’s what I saw,

With the update of new firmware, I’ve had to abandon tablo2go v2. I switched to 3.08 today and it is working great for me on my Linux desktop.

THANKS for all your hard work on tablo2go. If it were not for you, I think I would have moved onto another tuner.

Aloha!

I didn’t have a chance to work on this over the past weekend, but I will try to re-create and correct the issue with videos not being downloaded if they were in progress over the next few days.

Version 3.10 posted!

FIXED: Tablo2go was not attempting to download videos if they were not finished the first time the program ran.

Thanks for the bug reports, I have a cron job that runs at noon (and nothing is ever recording around then so I would have never noticed this, it will now automatically reload metadata for unfinished videos so that they can be downloaded)

Download from:

1 Like

Version 3.20 posted!

ADDED: Added support for command line arguments for all search terms and for main variables, see details in file.

Version 3.22 posted!

FIXED: No longer reloads movie and series metadata again if already stored.
FIXED: No longer removes all metadata if unable to find tablos

ADDED: Advanced debugging
ADDED: Option to show failed recordings

Thanks ! This is working for me. However, I’m not getting any subtitles / closed captions. Also, I was used to getting the .ts files, then using Handbrake_CLI to convert them to .mkv, and this included embedding the subtitles. I don’t understand :

FFMPEG_CMD = ’ -i “{m3u8}” -c copy -bsf:a aac_adtstoasc “{build}.mp4”’

maybe getting subtitles is buried in this command somewhere ???

This appears to be an issue with ffmpeg. It looks like subtitles do not survive with the creation of .mp4 files. I just re-implemented my old version 2 method of downloading files directly without the use of ffmpeg (to produces a clean .ts file)

So…

Version 3.3 posted!

ADDED: Ability to bypass ffmpeg completely for download, results in a .ts file, just set USE_FFMPEG to False, and you will receive a perfect copy download without modification.

The new firmware appears to break up the file into many many chunks…

Awesome ! I’ve got a couple downloaded, and everything looks great.
Thanks again.

Well, now I’m getting :;
… many good results, but then
Downloading 57/63 http://192.168.0.101:80/stream/segw.ts?p9cF05KNImkkPqQIsweHaA
Downloading 58/63 http://192.168.0.101:80/stream/segw.ts?3kvAwx9-lDOSJDphFa2KwQ
Downloading 59/63 http://192.168.0.101:80/stream/segw.ts?LHnN4JWpVKErHkW3qZVjug
Downloading 60/63 http://192.168.0.101:80/stream/segw.ts?pIJXQQGt-Jmq2Tb4I8vlbw
Downloading 61/63 http://192.168.0.101:80/stream/segw.ts?qAlToVo370lQrWCbM2RpLA
Downloading 62/63 http://192.168.0.101:80/stream/segw.ts?bGWd5QmK0kWjBdCqQmqMTQ
Downloading 63/63 http://192.168.0.101:80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00#EXT-X-ENDLIST
Traceback (most recent call last):
File “/usr/lib/python3.5/site-packages/requests/models.py”, line 346, in prepare_url
scheme, auth, host, port, path, query, fragment = parse_url(url)
File “/usr/lib/python3.5/site-packages/requests/packages/urllib3/util/url.py”, line 189, in parse_url
raise LocationParseError(url)
requests.packages.urllib3.exceptions.LocationParseError: Failed to parse: 192.168.0.101:80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “tablo2go-3.30_500GB.py”, line 552, in
elif (get_video(QUEUE[TABLO_IP][airing_num][‘m3u8’], QUEUE[TABLO_IP][airing_num][‘build’])):
File “tablo2go-3.30_500GB.py”, line 320, in get_video
resp = requests.get(url, stream=True)
File “/usr/lib/python3.5/site-packages/requests/api.py”, line 70, in get
return request(‘get’, url, params=params, **kwargs)
File “/usr/lib/python3.5/site-packages/requests/api.py”, line 56, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/lib/python3.5/site-packages/requests/sessions.py”, line 461, in request
prep = self.prepare_request(req)
File “/usr/lib/python3.5/site-packages/requests/sessions.py”, line 394, in prepare_request
hooks=merge_hooks(request.hooks, self.hooks),
File “/usr/lib/python3.5/site-packages/requests/models.py”, line 294, in prepare
self.prepare_url(url, params)
File “/usr/lib/python3.5/site-packages/requests/models.py”, line 348, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: 192.168.0.101:80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
[kkoceski@E4300_XFCE tablo2go_3.30]$

I just uploaded 3.31 which adds the capability for more debugging and a safeguard. See if that works, if not I may need you to run it with the debugging turned on to see what is happening.

OK, I’ll try that, but I want to let you know that after 3.30 encounters that error, it must mark that current show as downloaded, and stops ( as you see from my previous ).
If I start it again, it seems to work until it gets to a show that it doesn’t like again.
At this present time, it is still downloading successfully.

Hmm, not sure, which is why I added the capability for debugging, from your cut and paste above it looks like it returned a segment at the end that was not valid. If you want to redownload the file just remove it from the history file (it should be one of the last lines) and run again, but it was probably already complete.