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

I’m looking into compilation (ccextractor) under FreeBSD now. Please stand by.

And thanks for all the love and support folks… I just recently gave a presentation on SurLaTablo at DFWUUG

Couple of fixes coming up shortly… with that said, should “work” now, but I’m pretty picky about things…

Sounds good. I’ll be happy to offer my services for testing.

allen

Thanks for the --busyignore (-B) information. I think the CBS News Sunday is a valid busy but I think the others are from a long time ago. I will delete them and run another query.

Tom

On FreeBSD. download the ccextrator source zip and then download also this build file. Follow the instruction in that build file… and hopefully you’ll get a ccextractor executable. I tested all of this under FreeBSD 10.2. I tested the results by diffing the a FreeBSD srt file with one I produced in Linux (worked!).

SurLaTablo 1.5 Released (patient in hospital release)

###1.5 -
1.5 - (patient in hospital release)
1. Fixed some metadata problems.
2. Better tags handling for mp4 metadata.
3. Set some pre-defined transcoders as being --zapcommercials safe.

You may want to destroy your SurLaTablo caches (those files under SURLATABLO_ROOT/your-ip/) and have surlatablo.py recreate them.

Hope we can back to happiness soon :slight_smile:

Patient is still in the hospital, but I’ve got some ideas…

It works on Windows 7 now.

Was designed to work even in the wake of metadata changes… :smile:

Wanted to run SurLaTablo on my MacMini which now runs Lubuntu (a slimmed down Linux version for older computers). Had to upgrade from version 14 to 15 of Lubuntu since FFMpeg was not part of 14 and would not install. 15 now has an install for FFMpeg. SurLaTablo runs nicely on my MacMini. Thanks.

For people with older computers (e.g. Windows XP), Lubuntu is great for underpowered machines.

Let me know if the FreeBSD stuff I provided in the thread was good enough… thanks.

Hi, CJCOX.

The short answer is: I now have everything working. Surlatablo 1.5, CC extraction, recompress on the fly, moved to the proper directory location for PLEX.

For ccextractor, the solution unfortunately didn’t work. I didn’t want to bother you with it, because your continuing coding on Surlatablo is more important. I DID, however, find a solution which was provided by someone in the FreeBSD forum. It was a private conversation, so I’m trying to get permission to post his solution here. Bottom line: ccextractor now works. And the integration within Surlatablo is awesome.

For recompress on the fly, the ‘ultrafast’ switch didn’t generate any output. I had been using a shell script for batch processing recompression, so I just created my own set of parameters with those ffmpeg switches. Works like a champ.

Next steps for me is to learn cron to automate the script launch, and to learn how to trigger PLEX from the command line to initiate a library refresh.

Thanks again for ALL of the work. I couldn’t be happier with the surlatablo script :slight_smile:

allen

Just a suggestion… set up a cron that does ‘surlatablo.py’ periodically.

e.g.

# Every 4th hour do this, because we did not say -y, it will not overwrite existing entries.
0 */4 * * * surlatablo.py -q . -C -c Mp4

If your SURLATABLO_ROOT goes to a tree parse by your Plex, just let the normal periodic Plex library refresh find the entries.

Btw, I don’t do this… I do it all manually.

Ahhh - you saved me about an hour’s worth of googling.

Actually, until now, I had been doing it all manually. This is mostly due to needing to learn all processes/applications/etc. thoroughly first. Now that CC is working, transcoding is working, etc., I can relax in the knowledge that I KNOW how this thing works.

The logical progression in maturity of my HTPC project is to be fully, hands off automated.

(now, if we could only delete the recordings from tablo remotely)

Do I get a cookie if I make this work? :smile:

You get a six pack of your favorite beer. You live in AAAAAA, as I recall, so I could actually make that happen :smile:

(identifying info removed)

Getting the following error when trying to process a show. Looks like it is due to the special char in the naming. Wanted to share bug…

Error is
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2014’ in position 16: ordinal not in range(128)

Here is the full dump…

plex@titan:/usr/local/surlatablo # ./surlatablo.py -i 794024 -c
“794024”: {
“id”: 794024,
“meta”: {
“recEpisode”: {
“imageJson”: {
“images”: [
{
“imageID”: 794027,
“imageStyle”: “snapshot”,
“imageType”: “snapshot”,
“type”: “image”
}
]
},
“jsonForClient”: {
“airDate”: “2015-08-17T00:00Z”,
“description”: “The singer performs his biggest hits, including a duet with Elton John; documentary footage of the build up around his performance at the iconic venue.”,
“episodeNumber”: 0,
“objectID”: 794024,
“originalAirDate”: “2015-08-16”,
“qualifiers”: [
“cc”
],
“relationships”: {
“recChannel”: 22036,
“recSeason”: 794026,
“recSeries”: 794025
},
“scheduleDuration”: 3600.0,
“seasonNumber”: 0,
“type”: “recEpisode”,
“user”: {
“position”: 0.0,
“protected”: false,
“type”: “recordingUserInfo”,
“watched”: false
},
“video”: {
“duration”: 3920.0,
“height”: 720,
“scheduleOffsetEnd”: 305.0,
“scheduleOffsetStart”: -15.0,
“size”: 1623142400,
“state”: “finished”,
“width”: 1280
}
},
“jsonFromTribune”: {
“channels”: [
“5.1”
],
“duration”: 60,
“endTime”: “2015-08-17T01:00Z”,
“program”: {
“descriptionLang”: “en”,
“directors”: [
“Paul Dugdale”
],
“entityType”: “Show”,
“genres”: [
“Musical”,
“Special”
],
“longDescription”: “The singer performs his biggest hits, including a duet with Elton John; documentary footage of the build up around his performance at the iconic venue.”,
“origAirDate”: “2015-08-16”,
“releaseDate”: “2015-08-16”,
“releaseYear”: 2015,
“rootId”: “11987633”,
“seriesId”: “11987633”,
“shortDescription”: “The singer performs his biggest hits, including a duet with Elton John.”,
“subType”: “Special”,
“title”: “Ed Sheeran – Live at Wembley Stadium”,
“titleLang”: “en”,
“tmsId”: “SH022368160000”,
“topCast”: [
“Ed Sheeran”,
“Elton John”
]
},
“qualifiers”: [
“Stereo”,
“DD 5.1”,
“New”,
“HDTV”,
“CC”
],
“ratings”: [
{
“body”: “USA Parental Rating”,
“code”: “TVPG”
}
],
“startTime”: “2015-08-17T00:00Z”,
“station”: {
“affiliateCallSign”: “NBC”,
“affiliateId”: “10991”,
“callSign”: “KXASDT”,
“channel”: “5.1”,
“stationId”: “19627”
}
}
},
“recSeason”: {
“jsonForClient”: {
“objectID”: 794026,
“relationships”: {
“recSeries”: 794025
},
“seasonNumber”: 0,
“type”: “recSeason”
}
},
“recSeries”: {
“imageJson”: {
“images”: [
{
“imageID”: 764569,
“imageStyle”: “thumbnail”,
“imageType”: “series_3x4_small”,
“type”: “image”
},
{
“imageID”: 764570,
“imageStyle”: “cover”,
“imageType”: “series_4x3_large”,
“type”: “image”
},
{
“imageID”: 764571,
“imageStyle”: “background”,
“imageType”: “series_4x3_large”,
“type”: “image”
}
]
},
“imageJsonFromTribune”: [
{
“aspect”: “16x9”,
“category”: “Staple”,
“height”: “1080”,
“size”: “Ms”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h10_aa.jpg”,
“width”: “1920”
},
{
“aspect”: “16x9”,
“category”: “Staple”,
“height”: “720”,
“size”: “Lg”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h11_aa.jpg”,
“width”: “1280”
},
{
“aspect”: “16x9”,
“category”: “Staple”,
“height”: “540”,
“size”: “Md”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h12_aa.jpg”,
“width”: “960”
},
{
“aspect”: “16x9”,
“category”: “Staple”,
“height”: “270”,
“size”: “Sm”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h13_aa.jpg”,
“width”: “480”
},
{
“aspect”: “16x9”,
“category”: “Staple”,
“height”: “135”,
“size”: “Xs”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h14_aa.jpg”,
“width”: “240”
},
{
“aspect”: “4x3”,
“category”: “Staple”,
“height”: “270”,
“size”: “Md”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h3_aa.jpg”,
“width”: “360”
},
{
“aspect”: “4x3”,
“category”: “Staple”,
“height”: “135”,
“size”: “Sm”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h5_aa.jpg”,
“width”: “180”
},
{
“aspect”: “4x3”,
“category”: “Staple”,
“height”: “540”,
“size”: “Lg”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h6_aa.jpg”,
“width”: “720”
},
{
“aspect”: “4x3”,
“category”: “Staple”,
“height”: “1080”,
“size”: “Ms”,
“text”: “yes”,
“uri”: “assets/p11987633_st_h9_aa.jpg”,
“width”: “1440”
},
{
“aspect”: “3x4”,
“category”: “Staple”,
“height”: “180”,
“size”: “Sm”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v2_aa.jpg”,
“width”: “135”
},
{
“aspect”: “3x4”,
“category”: “Staple”,
“height”: “360”,
“size”: “Md”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v3_aa.jpg”,
“width”: “270”
},
{
“aspect”: “3x4”,
“category”: “Staple”,
“height”: “720”,
“size”: “Lg”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v4_aa.jpg”,
“width”: “540”
},
{
“aspect”: “2x3”,
“category”: “Staple”,
“height”: “360”,
“size”: “Md”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v5_aa.jpg”,
“width”: “240”
},
{
“aspect”: “2x3”,
“category”: “Staple”,
“height”: “180”,
“size”: “Sm”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v6_aa.jpg”,
“width”: “120”
},
{
“aspect”: “2x3”,
“category”: “Staple”,
“height”: “720”,
“size”: “Lg”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v7_aa.jpg”,
“width”: “480”
},
{
“aspect”: “2x3”,
“category”: “Staple”,
“height”: “1440”,
“size”: “Ms”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v8_aa.jpg”,
“width”: “960”
},
{
“aspect”: “3x4”,
“category”: “Staple”,
“height”: “1440”,
“size”: “Ms”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v9_aa.jpg”,
“width”: “1080”
}
],
“jsonForClient”: {
“cast”: [
“Ed Sheeran”,
“Elton John”
],
“description”: “The singer performs his biggest hits, including a duet with Elton John; documentary footage of the build up around his performance at the iconic venue.”,
“duration”: 3600.0,
“objectID”: 794025,
“originalAirDate”: “2015-08-16”,
“relationships”: {
“genres”: [
6351,
667
]
},
“title”: “Ed Sheeran \u2014 Live at Wembley Stadium”,
“type”: “recSeries”
},
“jsonFromTribune”: {
“cast”: [
{
“billingOrder”: “01”,
“name”: “Ed Sheeran”,
“nameId”: “679303”,
“personId”: “653360”,
“role”: “Musical Guest”
},
{
“billingOrder”: “02”,
“name”: “Elton John”,
“nameId”: “19441”,
“personId”: “19441”,
“role”: “Musical Guest”
}
],
“crew”: [
{
“billingOrder”: “01”,
“name”: “Stuart Camp”,
“nameId”: “941262”,
“personId”: “893310”,
“role”: “Executive Producer”
},
{
“billingOrder”: “02”,
“name”: “Kevin Weaver”,
“nameId”: “941261”,
“personId”: “893309”,
“role”: “Executive Producer”
},
{
“billingOrder”: “03”,
“name”: “Paul Dugdale”,
“nameId”: “819584”,
“personId”: “782252”,
“role”: “Director”
}
],
“descriptionLang”: “en”,
“directors”: [
“Paul Dugdale”
],
“entityType”: “Show”,
“genres”: [
“Musical”,
“Special”
],
“longDescription”: “The singer performs his biggest hits, including a duet with Elton John; documentary footage of the build up around his performance at the iconic venue.”,
“origAirDate”: “2015-08-16”,
“preferredImage”: {
“category”: “Staple”,
“height”: “360”,
“text”: “yes”,
“uri”: “assets/p11987633_st_v3_aa.jpg”,
“width”: “270”
},
“releaseDate”: “2015-08-16”,
“releaseYear”: 2015,
“rootId”: “11987633”,
“seriesId”: “11987633”,
“shortDescription”: “The singer performs his biggest hits, including a duet with Elton John.”,
“subType”: “Special”,
“title”: “Ed Sheeran – Live at Wembley Stadium”,
“titleLang”: “en”,
“tmsId”: “SH022368160000”
}
}
}
}
Traceback (most recent call last):
File “./surlatablo.py”, line 2950, in
doConvert(sl, options, basedirs, filename_pats, transcoder_names)
File “./surlatablo.py”, line 1519, in doConvert
if (os.path.isfile(fq_filename + fext)):
File “/usr/local/lib/python2.7/genericpath.py”, line 29, in isfile
st = os.stat(path)
UnicodeEncodeError: ‘ascii’ codec can’t encode character u’\u2014’ in position 16: ordinal not in range(128)

What is your base operating system?

One more favor, let me have the output of:

surlatablo.py -n -q rec_id~=794024 -Q '${friendly_title}'