Umm, let me amend what I said before... I loath bash, but tcl looks like a huge pain in the ass and makes literally no sense whatsoever to someone used to programming in a sensible programming language. smile

I think I can easily shave 20-30 lines from the original bash script, especially by optimizing the conditionals (they're currently done in a really lame way), but that tcl version looks infinitely more complicated to maintain. No offense of course as I imagine it's just the nature of the syntax.


Benefits of the bash/awk/xmlstarlet solution:

-Final xml metadata save file is formatted cleanly for human readability as well as programatic processing

-The script can handle getting HD versions of the trailers - I didn't see the ability to get anything but what was specified in the XML feed in the tcl version

-you can delete trailers or trailer folders that have been downloaded and the script will not re-download them - that benefit is realized by storing a list of downloaded trailers in a data file. This, IMO, is a very important necessity unless you want to keep a copy of absolutely everything going forward.

-Not in the version I pasted, but easy to modify, all visual output can be hidden making it even better suited for scheduling automated launching. I don't intend to run the script manually except while testing it initially.

I had a binary program for Windows that did a similar task but it didn't keep track of what had already been downloaded using an external file, so it suffered the same problem as the tcl above, plus I didn't like the way it names the movies. It also didn't allow downloading any resolution like the bash solution does, nor did it save the XML data for the movies (though a version was released as a plugin for Media Portal which I think may have done that specific to that host app).

All things considered this is a really trivial problem to solve and my only problem was using the tools for the already existing script (bash, xmlstarlet, awk and sed) which I have only ever touched so briefly in the past.

I still think this implemented in PERL or PHP would be a lot easier to follow from a code perspective and could be done a lot cleaner. At this point however this is working fine so I'm not concerned with redoing it. It does require the UTF-8 patch for cygwin, but it's for my own personal use anyway. Other people can feel free to take it to whatever next level they want. smile


_________________________
Bruno
Twisted Melon : Fine Mac OS Software