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

I’ll try to look more into this scenario tonight (can I get a few more hours in a day please?).

@cjcox hehe

cjcox, i’ve got another bug report for you.

When extracting “The Flash” off my Tablo it is putting it into a directory called “The Flash” which I would expect. The problem is that it’s not really “The Flash” it’s really “The Flash (2014)” cause it’s a rebooted series that’s independent from the original “The Flash”.

So what is happening is that when Plex scans the directory it is seeing it as the original “The Flash” and not “The Flash (2014)”.

Hope all this makes sense. I’m not sure how to address this since I’m using the Plex tagged meta data but I don’t see a Plex tagged meta option for series.

BASE_DIRS={‘Default’:’./${meta_type}’,
‘TV’:’/media/tvshows/${Eseries}/Season ${plex_season_number}’,
}

FILENAME_PATS={‘Default’:’${Etitle}’,
‘TV’:‘s${plex_season_number}e${plex_episode_number}-${Etitle}’,

Plex’s metadata agents could do this… but they don’t. You’d need to be able to analyze other pieces of the Tablo metadata (e.g. air_date) and correlate it to a better guess about how to search (for example) thetvdb.com. Surlatablo really can’t do this effectively (well, without a lookup table or something). The agent is the one not being smart, it has access to enough data to make a better guess. Tablo doesn’t.

So… since I too watch the Flash (the new one), best bet is to go into Plex and do a Fix Incorrect Match and change it to use The Flash (2014). That’s what I did… done…

I want to try to do something, but I need to see the SurLaTablo meta data lines for the shows “in conflict” (exact same name but different shows on same day). If you go to your SURLATABLO_ROOT/your-ip-address/rec_ids_cache.json (each item in on a line) and grab the elements that you know cause the problem… this will help me greatly to diagnose and fix. I can’t say that I’ll be able to effectively replicate the problem otherwise.

This info?

“7751”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7751, “sort_title”: “Episode 2016-05-09”, “video_offsetstart”: -15.0, “video_duration”: 2120.0, “video_offsetend”: 305.0,$
“7752”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7752, “sort_title”: “Episode 2016-05-09”, “video_offsetstart”: -15.0, “video_duration”: 2119.0, “video_offsetend”: 304.0,$
“7753”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7753, “sort_title”: “Episode 2016-05-09”, “video_offsetstart”: -15.0, “video_duration”: 2420.0, “video_offsetend”: 305.0,$
“7754”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7754, “sort_title”: “Episode 2016-05-10”, “video_offsetstart”: -15.0, “video_duration”: 1634.0, “video_offsetend”: -181.0$
“7755”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7755, “sort_title”: “Episode 2016-05-10”, “video_offsetstart”: -15.0, “video_duration”: 2119.0, “video_offsetend”: 304.0,$
“7756”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7756, “sort_title”: “Episode 2016-05-10”, “video_offsetstart”: -15.0, “video_duration”: 2421.0, “video_offsetend”: 306.0,$
“7780”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7780, “sort_title”: “Episode 2016-05-09”, “video_offsetstart”: -15.0, “video_duration”: 1823.0, “video_offsetend”: 8.0, "$
“7782”: {“rating”: “Unknown”, “tablo_ip”: “192.168.1.130”, “lair_date_year”: “2016”, “original_air_date_month”: “02”, “series”: “News With A Twist”, “rec_id”: 7782, “sort_title”: “Episode 2016-05-10”, “video_offsetstart”: -15.0, “video_duration”: 2120.0, “video_offsetend”: 305.0,$

bingo… thanks… I’ll let you know tonight what I’m able to come up with.

Actually, the data looks truncated… send me a PM and maybe email will work better.

We took our testing and conversation to private messaging… @riffy has a temporary fixed version of SurLaTablo and the promise of proper handling in the next release.

/cheers @cjcox :smiley:

Hey, @cjcox,

Getting this error trying to extract the latest “The 100” from Tablo unit. What is below is being reported by the script talking to the Tablo but when I look at the recorded information in Tablo it looks like this.

Tablo Web UI:
Perverse Instantiation — Part One Thu, May 12 9:00 PM–10:00 PM

Script Information:
TV Series/Program 148070
The 100 - s03e15 - Perverse Instantiation — Part One

Traceback (most recent call last):
File “/media/surlatablo/bin/surlatablo.py”, line 2991, in
doConvert(sl, options, basedirs, filename_pats, transcoder_names)
File “/media/surlatablo/bin/surlatablo.py”, line 1551, 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 63: ordinal not in range(128)

What version of SurLaTablo and which OS are you using?
(still could be a generic bug, I will look into this tonight)

Using the latest 1.7 version.

OS is FreeBSD 9.3

Uname -a:
FreeBSD tablorip_1 9.3-RELEASE-p31 FreeBSD 9.3-RELEASE-p31 #0 r288272+33bb475: Wed Feb 3 02:19:35 PST 2016

That episode has a non-ascii character in the title:

"friendly_title": "The 100 - s03e15 - Perverse Instantiation \u2014 Part One",

U+2014 is an “EM Dash”. Oops.

So @FlyingDiver just add the line above to my .conf file? Just a little fuzzy on your suggestion. :slight_smile:

Not a suggestion. Just more info for @cjcox when he goes to fix this.

Not exactly a fix thing just says BSD has more in common with Windows than we thought (inability to support UTF-8).

Or… maybe there’s a “switch” or something on the filesystem to support UTF-8 chars? (check for mount options)

add -o no_utf8_names=true or set options['no_utf8_names'] = true in your surlatablo.conf if your OS can’t handle UTF-8 chars in filenames (and let the BSD folks that they might not be all that i18n friendly).

So possible dumb question as I’m still figuring out the the script and it’s config file options, I assume just add that anywhere in the .conf file correct?

Yes… no indention (this is python after all!)

This thing is nice! How in the world is it finding & removing the commercials so fast? LOL