BinaryWorks.it Official Forum
BinaryWorks.it Official Forum
Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 eXtreme Movie Manager (Rel. 7), No More Updates
 Scripts
 My (sorta) mod to TV.Com script for individual ep.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gferley
Starting Member

Canada
11 Posts

Posted - 26 Nov 2005 :  00:06:06  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Throwing this out to the group to determine interest:

I've developed a custom front-end on my personal webserver to automatically try and determine correct episode information using the existing TV.Com script as a base. My reasons for this are due to my desired process of cataloging DVDs containing multiple episodes of various TV shows. I was not happy downloading an entire season's TV.Com information, then going back and individually specifying the actual files for each episode. Due to the current limitations of MagicScript, I decided to build a frontend that pre-searches TV.Com based on configurable requirements and accuracy level, and presents the correct page to the script so that you typically do not require interaction in selecting the episode to import. It took a day or two to write in ASP.NET, so the odds are there are still bugs in the process, but so far, I'm happy with the way it is behaving.

To get a better idea of my procedure, here it is:
1) Insert DVD with multiple episodes of a particular series, add to EMM using "Mass Files Add", one per file found. My files are typically named "Series - SeasonNumxEpiNum - Episode Title", which is more than enough info for locating the correct entry in TV.com. The filename is used as the Title of the record in EMM.
2) Using Multiple Changes Manager in EMM, assign a "Series" name to these new records. Season Number can also be applied at this time, though the script takes care of this during web import. Titles are adjusted to conform to my desired standard (i.e. sometimes they're burnt to disk with "216" as episode number, when now I want "2x16")
3) Now that all records have similar structure, I can import from the web, selecting all new records at once, and information is automatically pulled from TV.com. If a match cannot be made (I've also built in an "accuracy" configurable variable), the script behaves the same as it always does by listing possiblities and user selects.
4) Life continues as normal Onto the next DVD...

My frontend accepts the following input (via the query string):
1) Search string (from the Title)
2) A "filter" regular expression that tells it what info is contained in the Search string. This allows you your own naming standard (say you like S02E04, or no spaces between things, etc.) The series name MUST be a part of the Search string, and if you don't specify either a Title or Episode number, it will always force you to manually choose the correct episode (as the existing script does now).
3) Accuracy: High, medium or low. Your personal threshold of pain. Getting into the habit of a standard for filenames will allow you to set this once and forget it. For example, a high accuracy match would occur when all components you specify match exactly (series name, epinum, title), but keep in mind "shortened" series names (like "Buffy" for "Buffy the Vampire Slayer") can't be considered an exact match on the Series name. I can supply a grid explaining these levels later.

I will post more details later, as this post is becoming obscenely long already. Please reply to this post if this is something you want me to make public for all to use. My reasons for hesitating in making it public are that 1) it's an application that sits on my home server on a DSL connection, not the quickest speeds under huge load(though the box is a dual Xeon Intel server); 2) most of the work it performs may eventually be available in MagicScript; and 3) just curious about if others yearn for the same functionality in EMM that I do.

Love to hear your thoughts.

fer

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 26 Nov 2005 :  01:21:20  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi!

Of course I am really interested on this! Can you please write me an email with a link where I can test it? My english is terrible so is better if I see it "at work", so I can better understand the whole process.

Thank you!

Alessio
Go to Top of Page

gferley
Starting Member

Canada
11 Posts

Posted - 28 Nov 2005 :  06:14:57  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Email sent Alessio!
Go to Top of Page

gferley
Starting Member

Canada
11 Posts

Posted - 29 Nov 2005 :  01:59:19  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Some more points for Alessio and whomever else plays with my TV.com script/app:

Filter
------
The app uses the "filter" query string variable to determine what your MOVIE search term contains. For greater flexibility, I'm allowing it to be a regular expression, so those of you who are familiar with regex's understand what I'm talking about. Couple of points:
1) Regular expressions are slightly different in Microsoft than the ANSI standard. A good place to start for more info is http://msdn.microsoft.com/library/default.asp?URL=/library/en-us/dnclinic/html/scripting051099.asp
2) .NET supports Named Captures, and the app uses it for the key terms: <SeriesName>, <Season> for season number, <EpisodeNumber>, and <Title>. See http://aspnet.4guysfromrolla.com/articles/022603-1.aspx for more info on named captures.
3) Regular expressions use many characters that must be escaped in the query string, so it must be encoded prior to putting into the mod'ed script. There is currently no URLEncode/Decode or equivalent function in MagicScript, so you probably have to do it by hand (i.e. %20 for every space, etc.)

TV.com usually deals with Part 1, Part 2, ... of episodes by putting a (1), (2), ... after the episode title. My app "almost" handles this already, because it matches episode titles only up to what is provided, from left to right. Therefore, it will consider a match of "Welcome to the Hellmouth (1)" if your episode title is "welcome to the hellmouth". Unfortunately, most multi-part episodes reuse the same title, thus it may match the first occurance. You can minimize this by always requiring that both title and episode number matches (a "high" accuracy match, see below), though I probably will shortly add a <Part> named capture to support having the part number come from the filename and match correctly.

Accuracy
--------
Initially I thought that I'd only consider a perfect match on all submitted info to be the only time the app would consider a correct match and present it to the TV.com script without user selection. Obviously, there are many situations we could think of where it would be nice for the app to relax its requirements when finding the correct matching episode. A common example of this would be having only the series name and episode number on the file, like "Charmed 302.avi". By allow you to specify accuracy to my application, you can tell it series and epinum are enough information to determine a match on an episode. For now, it's easiest to describe accuracy and possible successful matches in a table:

Accuracy Series Epinum Title
-------- ------ ------ -----
high (Y|X) Y Y
high Y ? Y
high Y Y ?

medium Y Y X
medium Y X Y
medium X Y ?
medium X ? Y

low X X Y
low X Y X

(Symbols: "Y" - component matched, "X" - did not match, "?" - wasn't provided/unknown. Epinum is the combination of season and episode numbers. Sorry about the layout.)

I apologize to the less technical of us out there who might think this is all nonsense, but I prefer to give a more detailed instruction first, then help explain things along the way. Good luck all, hoping to see a few posts over the next while.

fer
Go to Top of Page

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 29 Nov 2005 :  21:20:21  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Script online, Thank you very much!

Alessio
Go to Top of Page

gferley
Starting Member

Canada
11 Posts

Posted - 29 Nov 2005 :  22:53:56  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Just added support for "Part" numbers, can now use the named capture ?<Part> in the filter variable. It supports either numbers or words ("One" or "five"), and matches on either "(1)",Part/Episode "One" at the end of the TV.Com episode title. It is certainly not required, and is considered part of the episode title for accuracy purposes. Had way too many Doctor Who episodes to enter, where my filename was "1 of 3" and TV.Com ended the title with ", Part One" or ", Episode One".

fer

Edited by - gferley on 30 Nov 2005 01:04:47
Go to Top of Page

biff_m
Starting Member

1 Posts

Posted - 23 Jan 2006 :  08:53:46  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello

I am new to this program, and I have no database or programming experience, butI would like to do this very thing. My episodes are all .avi files (xvid/divx) burned to DVD with no folders. The filenames all have a structured format: SeriesName.Season#Episode#.[YYYYMMDD].EpisodeName.avi

For example: alias.s03e08.[20031123].breaking.point.avi

I have thousands of files burned to hundreds of DVDs, so a script is probably what I need. Can someone point me in the right direction to learn to write a script (general information to help me use XMM)?

thanks in advance
biff_m

Edit: Or even better, can I get the script or access to the front end that is mentioned above? After posting, I reread and saw that the search can be based directly on specific file name formats. This is exactly what I need, I think 0:)

Edited by - biff_m on 23 Jan 2006 08:57:59
Go to Top of Page

Alessio Viti
Forum Admin

Italy
9171 Posts

Posted - 29 Jan 2006 :  10:44:20  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Sorry for my late reply but I wasn't at home this week.

At this time there isn't a feature to automatically "recognize" the Serie Name-Episode numberdirectly from a filename.

Anyway, I have add this to my work list for the future releases of XMM

Thank you!

Alessio
Go to Top of Page

gferley
Starting Member

Canada
11 Posts

Posted - 12 Feb 2006 :  05:09:55  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
With my script, you'd be able to pull the info for each episode from tv.com. Your process per CD/DVD would be the same as mine listed above:
1) Click "Add" on toolbar so new "empty" record comes up.
2)Select "Mass Files Add" tab, select DVD drive, click "Begin Scan", select each found file (right click and Select All) then click "Add One Movie for every selected file".
3) After exiting, your disk's episodes will be in the DB, but without a Series Name. On toolbar, click Multiple and check all the new files you just created (quick way is to use arrow keys and spacebar to select them). Right click, select "Assign a SERIES NAME to every select movie" and put in the correct series name. Now's also a good time to tweak the Movie Names into a naming convention if need be.
4) (only need to do this once) Click WWW on toolbar, select ONLINE scripts, when script selection pops up, click "Copy scripts on your HD". Close out, as we have to edit the now local copy of my script to put in a filter for your naming standard.
5) Click WWW on toolbar, select OFFLINE scripts. You only need to do this next part once (per naming standard). Expand TV.COM, highlight "fermod.txt" script. Click "Edit" button, and script editor will come up. The line near the top that starts with #WEBQUERY# is what you're after. You have to add a filter parameter that matches your filenaming convention. Claiming no programming experience, it's understandable that you probably can't create the right regular expression for your naming convention. Using what you say in your post:
SeriesName.Season#Episode#.[YYYYMMDD].EpisodeName.avi
a valid regex could be:
^(?<SeriesName>(.+))\.s(?<Season>(\d+))e(?<EpisodeNumber>(\d+))\.\[\d+\]\.(?<EpisodeTitle>(.+))
so you should add (append) to the #WEBQUERY# line in the script:
&filter=%5E(%3F%3CSeriesName%3E(.%2B))%5C.s(%3F%3CSeason%3E(%5Cd%2B))e(%3F%3CEpisodeNumber%3E(%5Cd%2B))%5C.%5C%5B%5Cd%2B%5C%5D%5C.(%3F%3CEpisodeTitle%3E(.%2B))
Now click "save" on editor toolbar, then exit. You should only have to do this one time as long as your filenames stay the same format.
6) Back in the Import Info from Web window, select your added movies on the left side. Make sure my script is still highlighted, then press the import with selected script button. Cross your fingers, and if the filter is right, info should start autoimporting for each episode. If the right episode can't be found, a list of all episodes should appear, so you can select the right one. If things don't go well, the odds are that the filter is not correctly matching the Movie Name.

I know this all sounds crazy, but you can do it. Post back with any errors or problems, and I can try and help. My big concern is using periods as both separators AND spaces in the filenames, and that the regex filter might not match it correctly in some cases. Good luck!


fer


quote:
Originally posted by biff_m

Hello

I am new to this program, and I have no database or programming experience, butI would like to do this very thing. My episodes are all .avi files (xvid/divx) burned to DVD with no folders. The filenames all have a structured format: SeriesName.Season#Episode#.[YYYYMMDD].EpisodeName.avi

For example: alias.s03e08.[20031123].breaking.point.avi

I have thousands of files burned to hundreds of DVDs, so a script is probably what I need. Can someone point me in the right direction to learn to write a script (general information to help me use XMM)?

thanks in advance
biff_m

Edit: Or even better, can I get the script or access to the front end that is mentioned above? After posting, I reread and saw that the search can be based directly on specific file name formats. This is exactly what I need, I think 0:)

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BinaryWorks.it Official Forum © Binaryworks.it Go To Top Of Page
Generated in 0.14 sec. Powered By: Snitz Forums 2000 Version 3.4.07