Suggestion for future addition

Apr 11, 2010 at 10:38 AM

Nothing too big I don't think, I managed to hack the source to achieve what I wanted and I haven't got a clue so I'm sure some who knows what they're doing could accomplish fairly simply!

  • Make the feed address a part of the config file. As mentioned, I use a filtered feed so would be handy to be able to update without a rebuild.
  • Give the option to discard anything in parenthesis when creating dirs. If there's multiple trailers, I'd rather have them in one dir for neatness and I also leave an instance of MCM running on my download dir to get whatever metadata it can and it doesn't play nice with parenthesis. Appreciate the MCM isn't your issue but think it could be dealt with neatly.
Apr 12, 2010 at 2:47 PM
Edited Apr 12, 2010 at 2:47 PM

the first one is easy, I'll add it and will post it soon

the second one - a little bit more tricky (string processing etc ;-)... is the desired outcome really to have the directory name without parenthesis? How is this supposed to be impacted by the 'AddDates' options? I assume this makes only sense if 'AddDates' is set to false? MCM will not recognize the movie with the prepended date anyway... perhaps we need a AddDateToFilename and an AddDateToDirectory option?

Apr 12, 2010 at 8:31 PM

Ah, is that option in the new one? I haven't downloaded that as I'm still running my hacked one. Where do the years come from?

I got rid of things in parenthesis altogether but fairly straightforward because my feed only has theatrical trailers so I just updated dir strings to:

(TrailerDownloadFolder + pathsep + feedItems[i].Title.Replace(":", "").Replace("?", "").Replace(" (Theatrical Trailer)", "")

I think for completeness would be good to have options to use title, trailer type and resolution (and years) in naming strings. Res is already available, title is string up to first parenthesis, type is string between parenthesis. If the name string can be split up from the feed title, end user could define any combo like

{title} ({year})\{title} ({year}) ({desc}).mov = The Other Guys (2010)\The Other Guys (2010) (Teaser Trailer).mov

{title}\{title} [{res}].mov = The Other Guys\The Other Guys [720p].mov

etc etc.

Either through specifying addxxxxtoyyyy options like you said or by specifying a string maybe..?


Not a show stopper at all though, would just cater for different fussy folks needs (including mine!!)

Thanks for looking at the feed one, might also be handy if the url ever changes.

Apr 13, 2010 at 7:44 AM

Hi -

interesting thoughts, but I think this was my point. It would be cool to get it right once and for all ... and there are so many options and tastes ;-)

btw: the replace of ':' and '?' in filenames is not sufficient, there can be more crap in there. I tried to get rid of all the garbage in the code (LegalFilename function, or something like that). You will also only replace the 'Theatrical Trailer', you probably want to replace all the stuff in parenthesis?


Apr 13, 2010 at 3:43 PM

what about this proposal:

How to specify directory and filenames:

 The following parts can be used in a directory name:


date:  is the date in the feed in the form (yyyy-mm-dd)


year: is the year part of the above date in the form (yyyy)


longname: Each title in the blog contains the trailer name. By specifying longname the trailer name (absent all illegal name-characters (i.e. ?) is represented


shortname: Is identical to longname, unless longname terminates in a space followed by a text in parenthesis. In that case this is being removed from the name


In addition the following parts can be defined in a filename

res: the resolution of the downloaded trailer (i.e. 480p)



The user can specify the naming scheme for his directories and filenames in the configuration file. Directory naming is only relevant, if the 'CreateFolder' option is set to true.



<key add="DirectoryName" value="{shortname} ({year})" />

 "Fetch (2010)"  

<key add="DirectoryName" value="{date} {shortname}" />

"2010-04-13 Fetch"

<key add="DirectoryName" value="{longname}" />

"Fetch (Trailer 1)"



<key add="FileName" value="{shortname} ({year})" />

 "Fetch (2010).MOV"  

<key add="FileName" value="{date} {shortname}" />

"2010-04-13 Fetch.MOV"

<key add="FileName" value="{longname}" />

"Fetch (Trailer 1).MOV"

<key add="FileName" value="{shortname}-{res}" />



 Please note that you can define naming schemes which will result in potential identical filenames. For example, the usage of {shortname} will create identical filenames if the blog containes multiple entries for the same movie. In that case, the added {date} option will not be able to resolve the conflict if the entries are posted on the same day!


What do you think, is this going to be versatil enough?

Apr 13, 2010 at 8:40 PM

Looks ideal, nicely done, pretty straightforward for a user to setup as well, set a default and list options in a comment.

While covering bases, what about appending a number if file found? Increment from 2 and loop until available...?


Apr 14, 2010 at 6:26 AM

sorry - I don't understand ... 

what is the purpose of the numbering scheme? Do you want to dis-ambiguiate (is this a word?) the downloaded files? This is tricky, it might work while using the exclusion list, but without the exclusion list there is no indication that a file has been downloaded. We would need to track that the clip for 'MOVIE (SCENES)' is stored as 'MOVIE1' and the additional clip for 'MOVIE (MORE SCENES)' is stored as 'MOVIE2'

Apr 14, 2010 at 7:44 PM

I was thinking about when a user sets a scheme that may result in duplicate filenames for different trailers. They set to be shortname only and there are 3 trailers.
Exclusion would still have to be based on feed title and wouldn't need filename. Can you run without exclusion? I haven't looked at that.


Apr 15, 2010 at 7:23 AM

This is exactly the problem ...

Assume we download the trailer 'Alien (Trailer 1)' and store it under the shortname 'Alien' on your local system. The next day we rescan the feed, at this point we have no idea that 'Alien (Trailer 1) was stored as 'Alien' on your system. (your unique numbering scheme would change this)

The exclusion list is a way out of this. It would prevent us from redownloading the trailer, since we know we did so already. In case a few days later 'Alien (Trailer 2)' is part of the feed we would recognize it has not been downloaded yet (as it is not part of the exclusion list, and at that point could save it under the name 'Alien 2' onto you local system.

looks like the exclusion list will get kind of mandatory to get this to work well


is this a problem for anyone?


Apr 15, 2010 at 8:50 PM

I didn't know you can run without exclusion and I cannot think of a single benefit of running without it, under what circumstances would you consider running without the exclusion file?

You get a trailer and watch it and then delete, or move within a couple of days, what stops it coming down again while it's still within the feed?


Apr 16, 2010 at 6:08 AM

the only thing preventing a redownload of feeditems is

- the trailer exists locally

- the trailer is part of the exclusions list

I agree - there is no point in not having the exclusionlist and not expect people to disable it.

I will think a little about the changes... thank you for the suggestion and discussion!

Apr 16, 2010 at 8:16 AM

I'm onboard with requiring the exclusions list if it will allow greater flexibility for people. Can't think of any reason to not have it enabled. Initially, I was relying solely on existing filenames to prevent dupes/re-downloads because i had a lot of available disk space and just let them sit there for 6 months or more without purging. People with less disk space were deleting much more frequently and therefore wanted something to prevent dupes even after a file was deleted. Once the exclusions list was coded, i jumped on the "less is more" bandwagon and moved to implement the auto-delete functionality.


By the way Wolfgang, thanks for the documentation!! Just noticed it :) 

Apr 16, 2010 at 3:39 PM

well - the documentation is slim at best ... mostly just your comments from the source code. Definitely needs more work ;-)

Exclusion List seems the way to go, I agree. But this list will keep growing. Perhaps we have to make the list a little bit smarter and remove any old entries from the list (add only to the beginning or so, and remove everything beyond entry X). Any consumed RSS feed has limited size, it is unlikely that you will run into 'ancient' entries in the RSS feed

Apr 16, 2010 at 8:25 PM

What about purge exclusions, oldest first, when it gets to 20 items? The current feed is only 20 items anyway. Maybe 50 to be sure in case that changes.

Mine is at 151 and doesn't seem to impact performance.

Apr 17, 2010 at 4:48 AM

it will have to grow significantly before it has a significant impact on performance... perhaps a few MB in filesize !

Apr 17, 2010 at 11:26 AM

Wow! nice app. Is it possible to configure this script to a downloader. (Just added only in 720p) m?

and yet you can port this application to MAC OS?

Apr 19, 2010 at 9:49 AM

I think the apple trailers will be mentioned in the consumed RSS feed. therefor I don't believe the apple site itself will have any trailers which we won't download

the application is written in C# .NET, this isn't natively available on the MAC, also the 'Mono' application is supposedly giving compatibility to other platforms. I have no experience with this.

The other options is running a Windows OS in a virtual PC in the MAC ...

Apr 19, 2010 at 11:14 AM

can i configure the script not to download trailers from hD-treailers? 

(i.e. to download only from - just added)

Apr 19, 2010 at 7:38 PM
bobjr wrote:

can i configure the script not to download trailers from hD-treailers? 

(i.e. to download only from - just added)

Curious what the reasoning is here... Do you not like trailers from other providers?

We rely completely on the HD-Trailers rss feed to do the leg work of finding new trailers for us. The easy way to do what you want would be for us to augment the exclusion list or config file to skip everything that's not coming from Apple. The hard way would be to catalog each actual trailer site (apple, ign, yahoo, etc) in our own DB and d/l when new ones pop up. Not sure the hard way is worth the work unless the rss feed goes away.


Apr 23, 2010 at 3:05 AM

Instead of starting a new thread I figured I can just add to this one  - I'm hoping to see an option to turn off the appending of the filenames with the type of trailer.  I'm using Media Center Master to fill in some info but it doesn't know how to handle that text

Apr 23, 2010 at 8:20 PM

The facility to do that is exactly what's being discussed and Wolfma described the options in his proposal above.

Apr 25, 2010 at 3:09 PM

yes, it is going to happen - I promise

right now it can't be my to priority. I should have it done in May ....

May 18, 2010 at 11:48 AM

I've edited the getPoster routine so it will save the poster with only the name of the movie. The same method could be used for the directories. 

An extra parameter is added to getPoster. movieName is splitted on ' ('. I've searched my trailer directory and couldn't find any file with more than 1 time the (. 

        static void GetPoster(string source, string downloadPath, string movieName)
                string[] mname = movieName.Split(' (');
                string fname = downloadPath + pathsep +  mname[0] + @".jpg";


And getOrResumeTrailer looks like this:

            //Assuming we downloaded the trailer OK and the config has been set to grab posters...
            if ( (tempBool) && (config.GrabPoster))
            // added fName 
                GetPoster(posterUrl, dirName, fName);

I don't have any experience with C# or C++ (can't even tell the difference) but this works fine for me :)

Note: I don't store the trailers in different directories but all in the same. 

May 18, 2010 at 3:18 PM

Minor thing to add... Without trim you keep whitespace between the moviename and the file extension. 


May 28, 2010 at 4:22 PM

I would actually like to exclude downloading any trailers from  Apple adds a watermark to all their trailers now.  Yahoo does not.  I tried to add the rss feed for yahoo movie trailers, but the way they format it, there are no urls in the rss feed.


May 28, 2010 at 5:57 PM
This should be rather easy to do. Either in the config file or
exclusion list. I'll try to look at it this weekend.

Sent from my iPhone
May 31, 2010 at 8:15 AM
radialmonster wrote:

I would actually like to exclude downloading any trailers from  Apple adds a watermark to all their trailers now.  Yahoo does not.  I tried to add the rss feed for yahoo movie trailers, but the way they format it, there are no urls in the rss feed.


Give version 1.1 a try. Make sure to edit the config with the domains you want to skip.

May 31, 2010 at 12:42 PM

Thanks for the new version.  1 would not run for me but 1.1 does.   Question - are you still going to add the option to turn off the "trailer" appending to the name?

May 31, 2010 at 11:17 PM
andy_d wrote:

Thanks for the new version.  1 would not run for me but 1.1 does.   Question - are you still going to add the option to turn off the "trailer" appending to the name?

It's still planned, but as Wolfma indicated, it's more complex than simply stripping off the parentheses since many movies have multiple trailers. We are not adding the "(Whatever)", rather it exists in the feed. See excerpt from feed below:


<title>Despicable Me (Behind the Scenes: Gru)</title>




I wonder if we could convince the Media Center Master to ignore vs us making the change.