TiVo Community Forum banner
  • TiVoCommunity.com Ambassador Program Now Open! >>> Click Here

New program for 1 step TTG downloads, decryption, encoding - kmttg

2M views 13K replies 921 participants last post by  mattack 
#1 ·
EDIT: This program has evolved a lot since this 1st post and now is written in Java and much easier to install than before (very easy on Windows and Mac OSX)... See http://sourceforge.net/projects/kmttg/ for details or visit the end of this thread for more up to date information.

kmttg is a Perl/Tk program I wrote to facilitate TivoToGo (TTG) transfers that can download, create pyTivo metadata, decrypt, run comskip & comcut (commercial detection and removal) and re-encode multiple shows you select from your Tivos all in 1 step.
You can select one or more shows at a time and then with one click of a button the program will download all the selected items, with the options of also automatically creating a metadata file for pyTivo, decrypting .TiVo files to .mpg, running comskip (commercial detection and removal program), and automatically re-encoding to a more portable format using mencoder, ffmpeg or any other command line encoder of your choosing. The program queues up multiple jobs and displays time, size and speed statistics for ongoing jobs.

For more information, screenshots and download visit:
http://sourceforge.net/projects/kmttg

Web page contains windows executables for all 3rd party tools used. The only other requirement of course is you must have Perl installed. Runs under Windows or Linux - tested with WinXP SP2 & Linux Red Hat Enterprise 4.

If you do try this out would appreciate some comments/feedback. For any programmers out there feel free to tinker and make improvements yourself.
 
See less See more
#2,170 ·
Hmm. Perhaps we should consider changing the extension?
I'd say let MS fix Windows Media Player, but since WMP 12 is already out and only runs on Windows 7, the chances of them going back to fix WMP 11 are nil.

A workaround for this issue on Windows is to open up the metadata file and save it with CR LF instead of LF. I was wondering why I have never seen this issue before and it's because I always manually edit the metadata files, thus changing LFs to CRLFs.

A less intrusive alternative to chaning the file extension for metadata files may be to create and option on the metadata generation to output Windows style metadata files with CRLF instead of LF.
 
#2,171 ·
I know a lot of you guys are using pytivo for goback, but I've just gotten kmttg and galleon going again on a windows box and I'm liking it. I can get basic tagging via file format using kmttg so that Galleon presents the video with Show/Episiode Name correctly. The only thing I'm missing is a process to rename a file with *_cut.mpg" to remove the "_cut" portion. I may have to write a small program to do it if I can't get it done in a batch file.
 
#2,172 ·
A less intrusive alternative to chaning the file extension for metadata files may be to create and option on the metadata generation to output Windows style metadata files with CRLF instead of LF.
This is already checked into SVN for next release. However there really is no excuse from MSFT side to crash an application just because a text file is not what is expected... As mentioned VLC also tries to do something with it and pops up an error message dialog box when it fails and keeps going for playback, which is the expected response.
 
#2,173 ·
I wondering if someone has already solved this. I'd like a custom command script which copies the encoded file, metadata file & .srt file to a specific subdirectory based on the file that was encoded. For example, I'd like episodes of Lost to go into the Lost subdirectory, episodes of House to go into the House subdirectory. I could write a small program to parse the filename or if kmttg had an [MainTitle] option available for the custom command, it could save me some time.

Seems like this might be something that is common enough that someone else might have already solved.
 
#2,174 ·
I wondering if someone has already solved this. I'd like a custom command script which copies the encoded file, metadata file & .srt file to a specific subdirectory based on the file that was encoded. For example, I'd like episodes of Lost to go into the Lost subdirectory, episodes of House to go into the House subdirectory. I could write a small program to parse the filename or if kmttg had an [MainTitle] option available for the custom command, it could save me some time.

Seems like this might be something that is common enough that someone else might have already solved.
Doesn't something like this in kmttg config already do that?
Code:
<tivoFileNameFormat>
[mainTitle][/][EpisodeNumber][-][episodeTitle]
I've got a Series2 that is setup for only manual recordings on a single channel, so I setup file naming to be this:
Code:
<tivoFileNameFormat>
[mainTitle][/][wday][.][year][-][monthNum][-][mday][.][hour][.][min]
 
#2,175 ·
Doesn't something like this in kmttg config already do that?

Code:
<tivoFileNameFormat>
[mainTitle][/][EpisodeNumber][-][episodeTitle]
Perhaps it does and I missed it. I thought the customer command script was limited to a different set of keywords than the filename formatter. Not sure how to handle series where mainTitle is not consistent season to season. Take Survivor for instance.

[Edit] Nevermind - Thinking about mainTitle inconsistency in the program guide, I'm going to have to parse filenames anyway to get files where I ultimately want them archived.
 
#2,176 ·
A less intrusive alternative to chaning the file extension for metadata files
BTW, I don't see this as intrusive. I'd continue to recognize the old names, just only generate the new ones going forward. We have about three programs that use this data, AFAIK, so it shouldn't be hard to coordinate. ".txt" was never a good extension anyway (it's too generic), except in that they actually are text files.
 
#2,177 ·
BTW, I don't see this as intrusive. I'd continue to recognize the old names, just only generate the new ones going forward. We have about three programs that use this data, AFAIK, so it shouldn't be hard to coordinate. ".txt" was never a good extension anyway (it's too generic), except in that they actually are text files.
I was assuming a hard cutover. A backwards compatible migration is certainly easier.
 
#2,178 ·
Is the Window's Service that kmttg looks for baked into the .jar file? I've installed a second instance of kmttg with different config.ini and auto.ini files. I've updated wrapper.conf to create a unique Service name, but prior to starting the new Service, I queried it from the second instance's "Service Status", and it reported that the Service was running. Is there a way to set the second instance to query the new Service? No big deal if not; I can use the Services.msc control the new Service when needed.
 
#2,179 ·
Is the Window's Service that kmttg looks for baked into the .jar file? I've installed a second instance of kmttg with different config.ini and auto.ini files. I've updated wrapper.conf to create a unique Service name, but prior to starting the new Service, I queried it from the second instance's "Service Status", and it reported that the Service was running. Is there a way to set the second instance to query the new Service? No big deal if not; I can use the Services.msc control the new Service when needed.
Service->Status essentially just runs the following windows command to check status:
sc query kmttg
(i.e. kmttg name is hard coded, so if you have a separate instance with a different name you need to monitor it by other means)
 
#2,180 ·
I know a lot of you guys are using pytivo for goback, but I've just gotten kmttg and galleon going again on a windows box and I'm liking it. I can get basic tagging via file format using kmttg so that Galleon presents the video with Show/Episiode Name correctly. The only thing I'm missing is a process to rename a file with *_cut.mpg" to remove the "_cut" portion. I may have to write a small program to do it if I can't get it done in a batch file.
Someone has already written the program for you: Bulk Rename Command. When you go to the download page scroll down to the bottom -- you want Bulk Rename Command (zip) not Bulk Rename Utility (installer for GUI version, I believe).

And here is the command line that should do what you want:

Code:
BRC32 /PATTERN:"*_cut.mpg" /REMOVELASTN:4 /EXECUTE /QUIET
The batch file or command window it's running in has to be logged to the folder containing the files to be renamed of course. There is good documentation in the download. It claims to do a number of other clever things but this feature is the only one I've used.
 
#2,181 ·
This is already checked into SVN for next release. However there really is no excuse from MSFT side to crash an application just because a text file is not what is expected... As mentioned VLC also tries to do something with it and pops up an error message dialog box when it fails and keeps going for playback, which is the expected response.
Many thanks for the quick response!
 
#2,182 ·
I know a lot of you guys are using pytivo for goback, but I've just gotten kmttg and galleon going again on a windows box and I'm liking it. I can get basic tagging via file format using kmttg so that Galleon presents the video with Show/Episiode Name correctly. The only thing I'm missing is a process to rename a file with *_cut.mpg" to remove the "_cut" portion. I may have to write a small program to do it if I can't get it done in a batch file.
You can probably do it using "custom" task:

1. Make a "ren.bat" script such as:
Code:
@echo off
rename "&#37;~f1" "%~nx2"
Then setup kmttg "custom" command to be:
Code:
<full path here>\ren.bat [mpegFile_cut] [mpegFile]
Then simply enable the "custom" task in addition to the other tasks for the job.

NOTE: Above assumes you are removing original .mpg file after _cut.mpg is generated and that _cut.mpg folder is the same folder you want to have the .mpg file end up in.

I think you get the idea even though that may not be exactly what you need.
 
#2,184 ·
In the current version (J) does the AD DETECT check box not save when you get out and back into the program? The AD CUT does save. Maybe it is just me.
Sorry
Confirmed. The setting is being saved but not restored when starting kmttg. Somewhere along the way in changes from 7i to 7j it looks like I accidently pasted over the lines to restore the Ad Detect setting when adding a new setting restore. Fixed in SVN for next release. Thanks for catching/reporting it.
 
#2,187 ·
is there a way to change the temp folder? its currently set to c:\windows\temp but i dont have a lot of space on the c drive. so it always makes the c drive full when transferring over 20-30GB files even though the save folder is set to another drive
What is taking up a lot of space under temp (which step/tool)? kmttg only uses it for some tiny files. curl downloads directly to your specified output dir so shouldn't use temp. I think perhaps VRD may use it for some encoding profiles but I don't recall any other 3rd party tool using much temp space.
 
#2,189 ·
That's odd, sounds like curl is using temp space then for some reason. So I assume once download completes the temp file goes away? Is the selected output dir a network drive by any chance?
You can probably change windows TEMP and/or TMP environment variable settings to use a different location for temp space, but I'm still curious to know why curl would need it...
 
#2,190 ·
So I assume once download completes the temp file goes away?
correct

Is the selected output dir a network drive by any chance?
nope. its a local hard drive.

but i should say this. my tivo is connected straight into the router, whereas my computer (and whs server) is connected via a gigabit hub to the router. not sure if it matters
 
#2,191 ·
this is for just downloading the file off of the tivo. thats all.

its a .tmp file and it looks like its the same size as the transfer file in my selected output directory

im using win7 x64
I just tried setting my ".TiVo Output Dir" setting to a different volume G: (a USB2 external drive) and tried a download. It worked as expected and the only file under %TEMP% is the expected 0 size "cookie*.tmp" used by curl. I didn't see any other .tmp file there while the download was ongoing. This was under Windows Vista.
Are you sure the file you are seeing is not just the 0 size cookie*.tmp file?
 
#2,194 ·
long time user of the old perl version of kmttg, now tried using the java version on a mac. when i kick off a batch of downloads from my TivoHD, it only downloads the first then gives a "Server Busy" error message for the rest. The Tivo stops responding to kmttg download requests or refreshes. Even the "Reset Tivo Web Server" option doesn't help, I need to reboot the Tivo. Any suggestions?
 
Top