Solved - Tablo Ripper move or store MP4 file in directory based on channel

Tablo Ripper converts and stores the MP4 files in D:\Tablo. I then run MCE Buddy and Comskip to remove commercials from the MP4 files and store the resulting files in D:\Tablo_No_Commericals. Everything works great! Tablo Ripper puts the channel in the file name perfectly.

I record a lot of PBS (Public Broadcasting System) shows that do not have commercials.

I would like to do an IF statement:

If the file name in D:\Tablo contains ch4.1 or ch4.2 or ch4.3 or ch4.4 then
Copy the file to D:\Tablo_No_Commericals
Delete the file from D:\Tablo
Else
Run MCE Buddy and/or Comskip on the file and store the resulting file in D:\Tablo_No_Commericals
Delete the file from D:\Tablo
End If

Any ideas on how I might do this would be very welcome and save hours of processing in MCE Buddy for no reason.

Thanks, CraigM

1 Like

How proficient are you at command prompt scripting? There’s an option in TabloRipper to run a postprocessing script. Useful of you want to extract closed captioning, or move your files, or - just about anything else.

Get the script working first, then add it to TabloRipper. Done.

PS: just in case anyone else notices, it’d really be helpful if you either post in the TabloRipper thread, or include @cyclej in your post. Either way I’ll get an email and remember to take a look. Otherwise you’ll need to wait for me to check the forum.

I really suck at scripting. I was hoping someone had invented this script so that I could edit it.

I’ll look into it further, but I am pretty shaky on programming and scripting.

Running a script to check the file names and move files that have the ch4. in them would be great. The move should start before MCE Buddy has a chance to grab and lock the file.

All help would be greatly appreciated. Thanks, CraigM

@cyclej

Help with spaces in the file name needed. Spaces cause %1 to be truncated.

I have got this working. Your suggestions were right on. I am running from the command prompt only at this time.

I removed the @echo off to see what was going on. from the command prompt. %1 was assigned the file name up to the first space. If the file name was “The Doctor Blake Mysteries.mp4” %1 was assigned “The”.

When I renamed the file so that there were no spaces (“TheDoctorBlakeMysteries.mp4”) in the file name it worked perfectly.

Here is my code. I only modified the paths in the move statements:

@echo off
@setlocal enableextensions enabledelayedexpansion
rem check for commercial-free channels
set str1=%1
if not x%str1:ch4.1=%==x%str1% goto no_mcebuddy
if not x%str1:ch4.2=%==x%str1% goto no_mcebuddy
if not x%str1:ch4.3=%==x%str1% goto no_mcebuddy
endlocal
:run_mcebuddy
move /y %1 “D:\Tablo Ripped Files”
goto exit
:no_mcebuddy
move /y %1 “D:\Tablo Commercials Removed”
:exit

THANKS! CraigM

I tried the “%1” and I get “The system cannot find thefile specified.” error message echoed to the command prompt screen.

I tried the “%1” on these three lines one line at a time with the same error messages.

set str1="%1"

move /y “%1” “D:\Tablo Ripped Files”

move /y “%1” “D:\Tablo Commercials Removed”

Craig

I ran the cmd as a post processing task (no quotes) and it ran and moved the file to the target directory. It named the file as the same name with all the spaces removed.

“The Doctor Blake Mysteries.mp4” became the “TheDoctorBlakeMysteries.mp4”.

What I don’t understand is when Tablo Ripper stores the file it uses the correct name with spaces. Yet, it appears to pass the %1 name with no spaces. This can’t be right, I have to not be seeing something.

If %1 had no spaces and the saved file name did, the cmd commands would see it as a different file name.

I am confused.

CraigM

Let me send you a PM and take this offline. I’ll see if I can help you get it going.

@TabloTV - Please move this thread to the third party apps category? Thanks!

Done :slight_smile:

This solution is used to move Tablo Ripper MP4 files out of the MCEBuddy Que without processing commercials. It will save enormous time and resources processing files that do not need or you do not want to remove commercials from.

I use this to move PBS shows that do not have commercials to a directory where I view programs from. It can be easily expanded (shown at the end) to include other channels as well.

To make this solution work you will need both

  1. Tablo Ripper and
  2. MCEBuddy

This solution requires the “Add channel” option on the Tablo Ripper Configuration page to be enabled and we will be using the “Post Processing” option on that page as well. The “Add channel” option places the channel number, in my case ch4.1, ch4.2, ch4.3 and ch4.4, in the file name. We will filter for “ch4” to get all of them.

I use the following three directories on my local hard Drive:

  1. Tablo Ripper Raw Files – This is where Tablo Ripper downloads the Tablo files and stores them as MP4’s
  2. Tablo with Commercials – This is where we will store files that we what MCEBuddy to remove commercials from. MCEBuddy needs to be configured to monitor this directory for new files.
  3. Tablo Commercials Removed – This is where all the MP4’s will end up for viewing.

Three directories are used to ensure that Tablo Ripper “Post Processing” has a chance to process the file before MCEBuddy grabs and locks the file for commercial removal.

On the Tablo Configuration page click the “Output Folder” browse button and browse to and select the “Tablo Ripper Raw Files” directory. This is where Tablo Ripper will place all of the MP4 files it creates when it pulls files from your Tablo.

Create the cmd file:

A cmd file is a batch file that contains a series of DOS (Disk Operating System) commands which are executed in order, top to bottom. It has been around since Windows NT.

Open Windows Notepad, not a word processor, and paste the code at the end of this post into it. Save the file with a .cmd extension. In the “Save As”, “File name:” box type the filename you choose followed by .cmd and click the save button. I use I use “tablo_post_processing.cmd” and save it in the “Tablo Ripper Raw Files” Directory. It is the only file I have in that directory.

On the Tablo Ripper Configuration page select the “Post Processing” browse option and browse to and select the cmd file you just created. I store my cmd file in my “Tablo Ripper Raw Files” directory. This cmd file will be executed moments after Tablo Ripper creates the MP4 file. It will sort the MP4 files between the directories; 1: Tablo with Commercials and 2: Tablo Commercials Removed.

That’s it, now Tablo Ripper will store the MP4 files from your Tablo to your hard drive “Tablo Ripper Raw Files”. Then Tablo Ripper will execute the “Post Processing” cmd file and in this example it will look at the file names for “ch4”.

If it finds ch4 in the file name it will move the file into the “Tablo Commercials Removed” Directory for viewing.

If it does not find “ch4” in the name it will move the file to the “Tablo with Commercials” directory where MCEBuddy will process the file, removing the commercials. MCEBuddy should be configured to use the “Destination” of “Tablo Commercials Removed” directory so that all of your output files end up in the same place for viewing.

Once you are absolutely certain that the system is working for you, you can configure MCEBuddy to delete the original files to eliminate duplication and save hard drive space. In your MCEBuddy “Monitor Locations” task, which you set to monitor the “Tablo with Commercials” directory, go to the “Expert Settings” option. Then select the “Delete original file” option and click “Ok” MCEBuddy will give you a warning click “Yes and “Ok” to close the “Expert Settings” window. Click “Ok” again to close the “Monitor Location” window and once more click “Ok” to close the MCEBuddy Settings window.

"ch4" Only

This Code (Goes into a MS Notepad file with a cmd extension (I use tablo_post_processing.cmd) it monitors the “Tablo Ripper Raw Files” and moves files with “ch4” in their file names to the “Tablo Commercials Removed” Directory . All other files will be moved to the “Tablo with Commercials” directory.

@echo off
@setlocal enableextensions enabledelayedexpansion

rem check for commercial-free channels
set str1=%1
if not x%str1:ch4=%==x%str1% goto no_mcebuddy
endlocal

:run_mcebuddy
move /y %1 “D:\Tablo with Commercials”
goto exit

:no_mcebuddy
move /y %1 “D:\Tablo Commercials Removed”

:exit

"ch4" and "Ch5.2"

This Code monitors the “Tablo Ripper Raw Files” and moves files with “ch4” or “ch5.2” in their file names to the “Tablo Commercials Removed” Directory . All other files will be moved to the “Tablo with Commercials” directory.

@echo off
@setlocal enableextensions enabledelayedexpansion

rem check for commercial-free channels
set str1=%1
if not x%str1:ch4=%==x%str1% goto no_mcebuddy
if not x%str1:ch5.2=%==x%str1% goto no_mcebuddy
endlocal

:run_mcebuddy
move /y %1 “D:\Tablo with Commercials”
goto exit

:no_mcebuddy
move /y %1 “D:\Tablo Commercials Removed”

:exit

Best wishes and good commercial hunting!

CycleJ was instrumental in developing this solution. I could have never done it myself.

CraigM

2 Likes

TY so much for this , my uses are abit diff as i want to separate certain recordings by channel from the rest and still remove commercials because those are manual recordings and it does not play nice with plex unless i put them on a different list for manual videos, with a bit of tinkering with MCEbuddy(setting up diff conversion tasks) this works perfectly, at first it was only moving some files but not the others and it was random until i realized i did not fully read your tutorial and skipped making the 3 directories, (only made 2 one for the raw files and one for my manual recordings) , basically MCEbuddy kept locking some of the files so Tablo ripper could not move them.

“Three directories are used to ensure that Tablo Ripper “Post Processing” has a chance to process the file before MCEBuddy grabs and locks the file for commercial removal.”

of course this was totaly my fault for not fully reading but i learned a few things here and there :grinning:

2 Likes