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


#1

UPDATE

A new version of tablo2go (3.02) has been posted on the website https://sites.google.com/a/moboard.com/tablo9 and is available for download, this is a complete rewrite using Tablo’s new API calls. I have also simplified it considerably as there are no command line arguments and only a few configuration items at the top of the file. This requires python3, the requests library (which you should hopefully already have installed by default), and ffmpeg (needed to download the files).

Version 3 was planned to be a simple command line tool to download files from the Tablo, a future version may be more feature rich.


The one feature I would love to see is the ability to list the recorded shows on the tablo, be able to selectively pull the associated metadata, and selectively pull off recordings via some sort of api or web call so that I can write a quick script to give me the functionality that I have with Tivo2go or kmttg.


Why, I am a slow TV watcher - I usually watch the news and a few shows live, but most is marathoning an entire season during bad weather.  Currently I do this via kmttg pulling shows automatically off of the TiVo and using plex as the media server.  I would love to have the same ability with tablo to populate my plex server.

Powershell API/Script to download files from Tablo
#2

check out the: http://community.tablotv.com/discussion/230/introducing-plex-channel-for-tablotv#latest


there are some videos i made which show this ability.

#3

Excellent!  My goal is just a bit different though; to be able to copy from the tablo specific and new tv shows and store them for much longer term on my plex server, which has an absurd about of storage space.  This way the plex server itself has the shows integrated so I can watch two year old episodes of shows like Big Bang Theory (I just finished the last season during the most recent rainy day.)


#4

Once this is released and Dave and I are in the maint. mode for the plex channel, I would be willing to build a plex scanner / Agent which would be completely separate from this… If there is enough interest in it of course.  It wouldn’t allow you to watch live tv but it would allow you to have the TabloRecordings within the PlexLibrary for syncing, etc (all the goodness you get from the plex libraries)


Very similar to what I built here:

http://forums.sagetv.com/forums/showthread.php?t=57842

#5

Seams like an interesting take on it, though I’ll happily start writing the scripts for a TiVo2go like functionality once tablo exposes the api, interface, or web calls.  If you haven’t seen how kmttg handles TiVo, I recommend that you take a look, this is the one last capability I need before I move on from the Roamios.


#6

@jskenney - We plan to add download functionality in the future which should enable you store programs for the long term. Stay tuned! 


#7

@TabloTV do you have an ETA for this? Or perhaps a roadmap?


#8

@TabloTV, just checking in.  Any word on when you will expose the api, interface, or web calls.  I’ll happily write some type of TiVo2go like program/scripts to perform the functions when this is available.


My goal remains:
1. list the shows that have completed recording on the Tablo(s)
2. download the shows that have not been downloaded already (and that meet some type of criteria)
3. download any available metadata for a show that is to be downloaded
4. post-process as necessary
5. perform show matching with theTVDB
6. rename and move the file to a standard convention (such as Show_Name - S01E01 - Episode_name.ext) 

I just need to know the calls for 1-3.  I would like to have a similiar (and completely automated) system like kmttg is for TiVo.

#9

I don’t have an ETA to share on this right now… That doesn’t mean it’s years away, just not in the next release. 


We are working on making the Tablo API more accessible to 3rd party developpers @jskenney so more people can do what @PiX64 and @DavidVR did with Plex. Stay tuned on this! 



#10

@jskenny When the time comes that they are ready for open access I’d be happy to give you a hand. 


#11
So using the info on http://community.tablotv.com/discussion/226/can-i-pull-recorded-video-files-off-tablo, I went ahead and finished the script that I needed, a simple python script which takes direction from the command line.  If the TabloTV folks don't object I will post it here somewhere (can we have attachments).

Simple usage:
$./tablo2go.py

Tablo Extractor (Version 0.1)

 Usage: ./tablo2go.py "search regex"

 Options:    -tablo:IP_ADDR  tablo ip address (multiple tablos seperated by a colon)

             -ffmpeg:PATH    path to ffmpeg (ex /bin/ffmpeg)

             -db:file        Tablo Extractor Database File

             -output:dir     Save final files here

 Note: Search Terms are optional and should be in a quote if more than one word.

Example:

$ ./tablo2go.py -tablo:192.168.2.168 -ffmpeg:/src/ffmpeg/bin/ffmpeg -db:/tmp/tablo2go.db -output:/kmttg "Whose Line"

Will go and update the database with all videos / metadata on the tablos (if the metadata has already been pulled it will not do this again) and then it will only pull back and assemble the videos that match the search string "whose line".  After the files are extracted they are marked as such and will not be processed again.


#12
So using the info on http://community.tablotv.com/discussion/226/can-i-pull-recorded-video-files-off-tablo, I went ahead and finished the script that I needed, a simple python script which takes direction from the command line.  If the TabloTV folks don't object I will post it here somewhere (can we have attachments).

Simple usage:
$./tablo2go.py

Tablo Extractor (Version 0.1)

 Usage: ./tablo2go.py "search regex"

 Options:    -tablo:IP_ADDR  tablo ip address (multiple tablos seperated by a colon)

             -ffmpeg:PATH    path to ffmpeg (ex /bin/ffmpeg)

             -db:file        Tablo Extractor Database File

             -output:dir     Save final files here

 Note: Search Terms are optional and should be in a quote if more than one word.

Example:

$ ./tablo2go.py -tablo:192.168.2.168 -ffmpeg:/src/ffmpeg/bin/ffmpeg -db:/tmp/tablo2go.db -output:/kmttg "Whose Line"

Will go and update the database with all videos / metadata on the tablos (if the metadata has already been pulled it will not do this again) and then it will only pull back and assemble the videos that match the search string "whose line".  After the files are extracted they are marked as such and will not be processed again.


#13

@jskenny From that linked post it looks like someone has been digging into the plex code but it needs to be understood that the API is not really supposed to be used at this point other than the plex plugin until Nuvvyo blesses it’s use for other projects. 


Also be aware that copying files off the tablo can severely degrade the performance of the unit while the transfer is in progress. As far as the notes in that thread, it is better to let ffmpeg read the m3u8 url in even though it is slower then to try to copy first, it acts like a throttle of sorts. 

#14

This is how I ended up doing it in python (I like to describe the process in my code), so I just cut and pasted that portion.  My use case is simple, I hardly ever watch live TV, mostly just items that recorded earlier are watched via a large data store on my plex server.  I posted the python script on https://sites.google.com/a/moboard.com/tablo/home if you want to review…


# Usage: ./tablo2go.py “search regex”
#  Options:    -tablo:IP_ADDR  tablo ip address (multiple tablos seperated by a colon)
#              -ffmpeg:PATH    path to ffmpeg (ex /bin/ffmpeg)
#              -db:file        Tablo Extractor Database File
#              -output:dir     Save final files here
#              -a              Reprocess ever 30 minutes, do not exit
#              -list           List videos on Tablo(s)
#              -handbrake      Post process with handbrake (and delete .mp4 file)
#  Note: Search Terms are optional and should be in a quote if more than one word.

# Example usage:
# ./tablo2go.py -db:/tmp/tablo2go.db -tablo:192.168.2.168 -ffmpeg:/src/ffmpeg/bin/ffmpeg -output:/share/Tablo -handbrake
# This will process all videos on the tablo at 192.168.2.168, further compress them, and store the in /share/Tablo/Series
# ./tablo2go.py -db:/tmp/tablo2go.db
# This will perform the same as the previous example as it will remember settings within the database
# ./tablo2go.py -db:/tmp/tablo2go.db -tablo:192.168.2.168:192.168.2.169 -ffmpeg:/src/ffmpeg/bin/ffmpeg -output:/share/Tablo Whose
# This will process the two tablos on 168, and 169 and only process those which match the search term “Whose”

# Process overview:
# 1. via get_list(IPADDR), view http://IPADDR:18080/pvr to determine what videos are available,
#    return a dictionary with {‘ids’: {‘VIDEOID1’:IPADDR, ‘VIDEOID2’:IPADDR, etc…}}
# 2. via get_meta(IPADDR, VIDEOID), view http://IPADDR:18080/pvr/VIDEOID/meta.txt to retrieve
#    associated metadata, returned in a dictionary {}
# 3. via proc_meta(IPADDR, VIDEOID, DATABASE), review metadata retrieved via step 2, searching
#    for series, season, episode, title, airdate, originalairdate, description, and recording
#    status and update database with this information.
# These are all called in turn via db_update(TABLOS, DB), which looks for new shows, aquires
# the metadata for only those shows that it has not processed before, processes the metadata,
# deletes shows that are no longer available from the database, revisists those that were
# recording previously.
# 4. if a search string is entered only process items that match, and that have finished recording,
#    and that have not been processed in the past.
# 5. via get_video(IPADDR, VIDEOID, DIRECTORY, FFMPEG, FILENAME), each .ts file at
#    http://IPADDR:18080/pvr/VIDEOID/segs is downloaded to tmp (with a prepended UUID), upon
#    completion, it is rebuild using the ffmpeg command noted on the discussion board
#    at http://community.tablotv.com/discussion/226/can-i-pull-recorded-video-files-off-tablo via
#    FFMPEG -i “concat:file1.ts|file2.ts|…” -bsf:a aac_adtstoasc -c copy “DIRECTORY/FILENAME.mp4”’
#    For TV shows this ends up as /DIRECTORY/Series_Name/Series_Name - S01E01 - Episode.mp4",
#    for Movies this would be /DIRECTORY/Movie_Name (Year).mp4".
# 6. if postprocessing is desired, HandBrakeCLI is called with (my traditional kmttg settings)
#    HandBrakeCLI -i “DIRECTORY/FILENAME.mp4” -f -a 1 -E copy -f mkv -O -e x264 -q 22.0
#    --loose-anamorphic --modulus 2 -m --x264-preset medium --h264-profile high --h264-level 4.1
#    --decomb --denoise=weak -v -o “’+DIRECTORY/FILENAME.mkv”
#    and the original mp4 is deleted.
# 7. Mark within the database as processed, move onto the next file, loop as necessary if
#    ran as a service.

#15

Currently pulling a full movie off using a wget while watching a Live HD show… no performance degradation noticed at all.

Maybe there will be some issue if recording rather than watching live, but you know… come to think of it, I think it’s recording right now.

Maybe there’s more headroom than you think @davidvr


#16

@cjcox what I found i could not download and watch a different recording at the same time. That was a couple of firmware revisions ago in a two tuner. I haven’t tested recently but it might of changed


#17

I performed a test this morning.  I recorded 4 shows, started downloading videos via my scripts, and watched the previously recorded “The Tonight Show” all at the same time.  The roku app for watching TV was slower, but the video played perfectly.  Reviewing the videos that were pulled off (recorded earlier), I saw no issues.  I also pulled down the videos that were recording at the time and saw no issues.


So, no stuttering or issues noted with 6 simultaneous events (4 recording, 1 recorded video playing via roku, and recordings being pulled).

Now I just need the system to record 5.1 sound vice just stereo (I just noticed this when comparing the TiVo recordings to the TabloTV recordings).  Is there a setting that I missed?

#18

@jskenney - We don’t yet support 5.1 sound, so no you’re not missing a setting.


#19

@TabloTV - thanks for the info!  


I ordered my second 4-tuner Tablo yesterday, plan is to replace the two OTA TiVo Roamios.  Will ‘hopefully’ use the exact same type of setup as I have configured with the TiVo’s, which will be one Tablo which only knows about CBS,ABC,NBC, and FOX (and acts rather stand-alone), while the second knows all including CW,BBC,PBS,News and will serve up the roku’s in the house.

This has been rock solid so-far, and now that I can populate my plex database - I am really impressed.

#20

@jskenney - Awesome! Thanks for ordering #2


Please note that Plex doesn’t yet support multiple Tablos though…