TiVo Community
TiVo Community
TiVo Community
Go Back   TiVo Community > Main TiVo Forums > TiVo Home Media Features & TiVoToGo
TiVo Community
Reply
Forum Jump
 
Thread Tools
Old 02-13-2011, 02:04 PM   #1
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
Program to create .txt files for show series?

Is there a script or program that will create a txt file for a bunch of tv show files so that it will be sent over in one folder.

I believe there is a tutorial to do it manually, but wanted a way to automate it.

For example, I have a bunch of work out videos in mp4 format. I would like to transfer them over to tivo premiere under one folder, let's call it "P90X". Is there a way to automate this?
superflysocal is offline   Reply With Quote
Old 02-13-2011, 02:57 PM   #2
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
I'm about to go function with the family, but think I have time to post this bit of Windows command line that I use in a script that pushes videos:

Code:
:MetaData
::-----------------------------------------::
:: Create metadata if there isn't any      ::
::-----------------------------------------::
IF NOT EXIST "%~dpnx1.txt" (
	"\\DL380-Server\lan path\pyTivoMetaThis.py" -d -p "!ThisPath!"
)
IF NOT EXIST "%~dpnx1.txt" (
	>"%~dpnx1.txt" ECHO episodeTitle : "%~n1"
)
%1 indicates a full path+filename variable passed to the script. Using the tilde (~) and lowercase letters (dpnx) will cull file attributes from the variable, specifically:

d = drive letter
p = path
n = file name
x = file extension

So the above looks for full path+filename+.txt (the metadata file). If one is not found, try to create one using pyTivoMetaThis (preferred). If pyTivoMetaThis cannot find a match in the database (which would be your situation with P90X), it would fall through to creating a simple metadata file with only the filename as the episode title. More "ECHO"s would be required to add in seriedId, isEpisodic, isEpisode, title, or whatever other keywords that are required for consistent grouping.

I could help with a script after the family function, if Windows is the OS flavor you use, and if you wanted to provide a bit of detail as far as your directories are structured (could help determine if hardcoded directory names would be wanted/needed in the script, or "drag & drop" of a folder onto the script would be wanted/needed). PM's may be more appropriate for the nitty-gritty details.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 02-13-2011, 03:15 PM   #3
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
Dude that would be so awesome if you can help me with this. The more drag and drop, the easier to use, the better. i am surprised no one has desired this before.

this is what I think is needed minimally:

title : P90X
SeriesTitle: P90X
episodeTitle : P90X - 02 - Pylometrics
episodeNumber : 2
isEpisode :true
seriesId : SH999905

right now file name is in this format, though not sure if it is necessary.
P90X_S01E02_Pylometrics.avi

Last edited by superflysocal : 02-13-2011 at 03:28 PM.
superflysocal is offline   Reply With Quote
Old 02-13-2011, 10:58 PM   #4
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by superflysocal View Post
Dude that would be so awesome if you can help me with this. The more drag and drop, the easier to use, the better. i am surprised no one has desired this before.

this is what I think is needed minimally:

title : P90X
SeriesTitle: P90X
episodeTitle : P90X - 02 - Pylometrics
episodeNumber : 2
isEpisode :true
seriesId : SH999905

right now file name is in this format, though not sure if it is necessary.
P90X_S01E02_Pylometrics.avi
Quick question: Are your titles grouped in folders, or are they all like the example shown above, where the title is part of the filename? Or a combination of both?
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 02-14-2011, 08:38 PM   #5
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
both, i think.

all the files are currently in one folder called P90X

Each file name is like above P90X_S01Exx_nameofworkout.avi
superflysocal is offline   Reply With Quote
Old 02-14-2011, 09:02 PM   #6
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by superflysocal View Post
both, i think.

all the files are currently in one folder called P90X

Each file name is like above P90X_S01Exx_nameofworkout.avi
Ok. I'll probably end up making two versions: One to use the folder's name to create the title & seriesTitle keyword values, with episodeTitle being the filename as more of a general purpose script, and a second that parses the filename to get that information.

And something else came up during a discussion of seriesIds in another thread: Do you intend to push or pull the videos to TiVo? Push is when the pyTivo web interface is used to send a file to a selected TiVo; Pull is when the file is selected from the pyTivo share found in the NPL, on the TiVo itself...
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 02-14-2011, 09:27 PM   #7
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
I usually would push but I forgot which one is better or faster so I can go either way.

thanks.
superflysocal is offline   Reply With Quote
Old 02-18-2011, 11:25 AM   #8
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
I haven't given up on this. Just got wrapped up in other projects. I also was going to try to incorporate pyTivoMetaThis into the script, but I'm going to abandon that effort*. However, I will incorporate the "Tidy" feature as an option, where the metadata files are stored in a ".meta" subdirectory.

*The pyTivoMetaThis that I use has been customized by me to also accept filenames instead of just a folder name as input to that program. I'd rather not have to have a requirement of using that customized program to make this Windows script work.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 02-18-2011, 03:46 PM   #9
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
MetaFiles.bat

This version uses the directory name as the title, seriesTitle, and seriesId, while the file name is used for the episodeTitle and description.
When it is run for the first time, it will ask: "Use pyTivo .meta directory to store metadata? (Y/N)". This gives the ability to store the metadata files in a ".meta" subdirectory, essentially keeping the video directory clear of text files.

Drag a single file, a group of files, a single directory or a group of directories onto the batch file to process the video files. Tested on WinXP, and offered "as-is".

Code:
::-----------------------------------------::
:: Set batch file parameters and options.  ::
::-----------------------------------------::
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
2>NUL CALL :Set_Options || IF !ERRORLEVEL! GTR 0 CALL :Get_Options

:Loop
::-----------------------------------------::
:: Process until arguments are empty       ::
::-----------------------------------------::
IF "%~1"=="" GOTO Done

::-----------------------------------------::
:: Test for file, directory, or UNC path   ::
::-----------------------------------------::
2>NUL PUSHD "%~1"
IF /I %errorlevel% EQU 1 (
    PUSHD "%~dp1"
    CALL :Is_File "%~nx1"
    POPD
) ELSE (
    CALL :Is_Directory "%~1"
    POPD
)

:End
::-----------------------------------------::
:: Argument is processed, go get next one  ::
::-----------------------------------------::
SHIFT
GOTO Loop

:Done
::-----------------------------------------::
:: Go back from wence you came             ::
::-----------------------------------------::
EXIT /B

::-----------------------------------------::
:: A file/set of files has been passed to  ::
:: the script. Use the file name as        ::
:: episode title.                          ::
::-----------------------------------------::
:Is_File
SET ThisPath=%~dp1
SET ThisPath=!ThisPath:~0,-1!
SET episodeTitle=%~n1
CALL :Get_title "!ThisPath!"
IF NOT EXIST "%~dpnx1.txt" (
    IF /I "!UseMetaDir!" EQU "Y" (
        IF NOT EXIST "!ThisPath!\.meta" (
            MKDIR "!ThisPath!\.meta"
            SET where="!ThisPath!\.meta\%~nx1.txt"
            CALL :Create_Meta_File "!where!"
        ) ELSE (
            SET where="!ThisPath!\.meta\%~nx1.txt"
            CALL :Create_Meta_File "!where!"
        )
    ) ELSE (
        SET where="!ThisPath!\%~nx1.txt"
        CALL :Create_Meta_File "!where!"
    )
)
GOTO :EOF

::-----------------------------------------::
:: A directory was passed to the script.   ::
:: Look for known video extenstions, and   ::
:: create metadata for all files found.    ::
::-----------------------------------------::
:Is_Directory
CALL :Get_title "%~1"
FOR %%A IN (%extensions%) DO (
    FOR /F "delims=" %%B IN ('DIR /B /S "%~1\%%A"') DO (
        IF /I "%%~xB" NEQ ".txt" (
            SET episodeTitle=%%~nB
            IF /I "!UseMetaDir!" EQU "Y" (
                IF NOT EXIST "%~1\.meta" (
                    MKDIR "%~1\.meta"
                    SET where="%~1\.meta\%%~nxB.txt"
                    CALL :Create_Meta_File "!where!"
                ) ELSE (
                    SET where="%~1\.meta\%%~nxB.txt"
                    CALL :Create_Meta_File "!where!"
                )
            ) ELSE (
                SET where="%~1\%%~nxB.txt"
                CALL :Create_Meta_File "!where!"
            )
        )
    )
)
GOTO :EOF

::-----------------------------------------::
:: Display the metadata that has been      ::
:: constructed, then write the data to the ::
:: appropriate location.                   ::
::-----------------------------------------::
:Create_Meta_File
ECHO title : !title!
ECHO seriesTitle : !title!
ECHO seriesId : !title!
ECHO episodeTitle : !episodeTitle!
ECHO description : !episodeTitle!
ECHO isEpisode : true
ECHO isEpisodic : true
ECHO.
    
> !where! ECHO title : !title!
>>!where! ECHO seriesTitle : !title!
>>!where! ECHO seriesId : !title!
>>!where! ECHO episodeTitle : !episodeTitle!
>>!where! ECHO description : !episodeTitle!
>>!where! ECHO isEpisode : true
>>!where! ECHO isEpisodic : true
GOTO :EOF

::-----------------------------------------::
:: Set the directory name to be the title. ::
::-----------------------------------------::
:Get_title
SET title=%~nx1
GOTO :EOF

::-----------------------------------------::
:: Set the filename to be the episode      ::
:: title.                                  ::
::-----------------------------------------::
:Get_episodeTitle
SET episodeTitle=%~n1
GOTO :EOF

::-----------------------------------------::
:: Update the script with user options.    ::
::-----------------------------------------::
:Get_Options
SET extensions=*.3g* *.amv *.asf *.av* *.bi* *.box *.bsf *.dat *.di* *.dmb
SET extensions=%extensions% *.dpg *.dv* *.evo *.eye *.fl* *.gvi *.ivf *.m1v
SET extensions=%extensions% *.m2* *.m4* *.mjp* *.mkv *.mod *.moov *.mov* *.mp* 
SET extensions=%extensions% *.mqv *.mts *.mvb *.nsv *.nu* *.ogm *.qt *.rm* *.rts
SET extensions=%extensions% *.scm *.smv *.ssm *.svi *.tivo *.tp *.trp *.ts *.vdo
SET extensions=%extensions% *.vfw *.vi* *.vob *.vp* *.vro *.wm* *.yuv

SET /P UseMetaDir=Use pyTivo .meta directory to store metadata? ^(Y/N^) 
SET UseMetaDir=!UseMetaDir:~0,1!
IF /I "!UseMetaDir!" EQU "Y" (
    SET UseMetaDir=Y
) ELSE (
    SET UseMetaDir=N
)

>>"%~dpnx0" ECHO :Set_Options
>>"%~dpnx0" ECHO SET extensions=*.3g* *.amv *.asf *.av* *.bi* *.box *.bsf *.dat *.di* *.dmb
>>"%~dpnx0" ECHO SET extensions=%%extensions%% *.dpg *.dv* *.evo *.eye *.fl* *.gvi *.ivf *.m1v
>>"%~dpnx0" ECHO SET extensions=%%extensions%% *.m2* *.m4* *.mjp* *.mkv *.mod *.moov *.mov* *.mp*
>>"%~dpnx0" ECHO SET extensions=%%extensions%% *.mqv *.mts *.mvb *.nsv *.nu* *.ogm *.qt *.rm* *.rts
>>"%~dpnx0" ECHO SET extensions=%%extensions%% *.scm *.smv *.ssm *.svi *.tivo *.tp *.trp *.ts *.vdo
>>"%~dpnx0" ECHO SET extensions=%%extensions%% *.vfw *.vi* *.vob *.vp* *.vro *.wm* *.yuv
>>"%~dpnx0" ECHO SET UseMetaDir=!UseMetaDir!
GOTO :EOF
Edit: This is for Push metadata only. With the "unusual" seriesId, attempting to Pull the videos will likely fail to group.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by orangeboy : 02-18-2011 at 04:05 PM.
orangeboy is offline   Reply With Quote
Old 02-27-2011, 06:27 PM   #10
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
Thank you so much!!! I think it works! Can i use pytivo to push the avi files now to Tivo an have it all show up under one folder, or do i still have to do the trick where you send one dummy file first?

If so, anybody has a link to instructions on how to send it over and appear in one folder? I can't find it anymore. Also, orangeboy, how would I incorporate seriesID into this? maybe have it ask at the beginning if there is a seriesid? I think you need it to be able to put it in one folder, right?

Would episodeNumber be required also??

Again, a big thanks
superflysocal is offline   Reply With Quote
Old 02-27-2011, 06:50 PM   #11
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by superflysocal View Post
Thank you so much!!! I think it works! Can i use pytivo to push the avi files now to Tivo an have it all show up under one folder, or do i still have to do the trick where you send one dummy file first?

If so, anybody has a link to instructions on how to send it over and appear in one folder? I can't find it anymore. Also, orangeboy, how would I incorporate seriesID into this? maybe have it ask at the beginning if there is a seriesid? I think you need it to be able to put it in one folder, right?

Would episodeNumber be required also??

Again, a big thanks
Well, I was going to try to incorporate a pyTivoMetaThis as an initial step to get much more valid/accurate data, and resort to using the (computer) folder name as the title, and filename as the episodeTitle. I learned in this post that the seriesId doesn't need to be numeric at all, so I didn't bother with trying to generate an integer as a value for that field. As long as all the files are in the same (computer) folder, they will group correctly when you pyTivo PUSH them. episodeNumber shouldn't be required for the files to group correctly.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 03-03-2011, 08:12 AM   #12
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
This appears to work for the p90x files.

However, I now tried this with a more conventional show and it doesnt appear to go through pytivometathis (which is located in the same folder as this bat script)

here are the files:

Nikita_S01E11.avi
Nikita_S01E12_Free.avi
Nikita_S01E13_Coup_De_Grace.avi

edit: just reread your previous post, guess you decided not to incorporate pytivometathis?
superflysocal is offline   Reply With Quote
Old 03-03-2011, 10:28 AM   #13
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by superflysocal View Post
This appears to work for the p90x files.

However, I now tried this with a more conventional show and it doesnt appear to go through pytivometathis (which is located in the same folder as this bat script)

here are the files:

Nikita_S01E11.avi
Nikita_S01E12_Free.avi
Nikita_S01E13_Coup_De_Grace.avi

edit: just reread your previous post, guess you decided not to incorporate pytivometathis?
Correct. If you already have pytivometathis "capable" files, I'd say just use that. It will produce much better metadata.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 03-03-2011, 12:10 PM   #14
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
is there a way to do that with drag drop method of this batch file without using command line?
superflysocal is offline   Reply With Quote
Old 03-03-2011, 12:54 PM   #15
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
You might be able to drag the folder onto the .py file? I don't have anything that needs metadata at the moment to try...
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 03-03-2011, 05:22 PM   #16
superflysocal
Registered User
 
Join Date: Nov 2009
Posts: 62
Thanks. folder drop works for pytivometathis!

Last edited by superflysocal : 03-06-2011 at 02:40 PM.
superflysocal is offline   Reply With Quote
Old 03-03-2011, 05:54 PM   #17
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by superflysocal View Post
Thanks. folder drop works!

__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 04-11-2011, 01:56 PM   #18
oregonman
Registered User
 
Join Date: Jul 2002
Location: Portland OR
Posts: 82
Thank you for doing this script. I was searching for how to push my videos to a folder and found this thread. The script works like a charm.
oregonman is offline   Reply With Quote
Old 04-11-2011, 02:05 PM   #19
orangeboy
yes, I AM orangeboy!
 
Join Date: Apr 2004
Location: Moline, IL
Posts: 4,075
Quote:
Originally Posted by oregonman View Post
Thank you for doing this script. I was searching for how to push my videos to a folder and found this thread. The script works like a charm.
Glad to hear it!
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
orangeboy is offline   Reply With Quote
Old 10-02-2012, 12:41 PM   #20
johnfarmer55
Registered User
 
Join Date: Mar 2009
Posts: 17
orangeboy you are AWESOME! This does indeed work like a charm! Except of course for files i've tried pushing with previous metafiles. I think the tivo somehow remembers these files being associated with a different group. It seems renaming them and moving them to a different folder seems to work. Thanks for this awesome little gem!
johnfarmer55 is offline   Reply With Quote
Reply
Forum Jump




Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Advertisements

TiVo Community
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
vBulletin Skins by: Relivo Media

(C) 2013 Magenium Solutions - All Rights Reserved. No information may be posted elsewhere without written permission.
TiVoŽ is a registered trademark of TiVo Inc. This site is not owned or operated by TiVo Inc.
All times are GMT -5. The time now is 04:34 AM.
OUR NETWORK: MyOpenRouter | TechLore | SansaCommunity | RoboCommunity | MediaSmart Home | Explore3DTV | Dijit Community | DVR Playground |