home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
MyTrailers
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Rick164" data-source="post: 291382" data-attributes="member: 17766"><p>Thanks for the script, gonna write one in c#(.net) with this as the example <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p><p>Will share it here when it's finished so that windows users can also use it.</p><p></p><p>/edit: done, it's a console application with a config file for the folder locations.</p><p>Here is the early code i have written, it checks if the folder or file already exists and has a settings.xml file for the folder locations and to select what version to download(hd or normal_hres):</p><p></p><p>[code]</p><p>using System;</p><p>using System.Text;</p><p>using System.IO;</p><p>using System.Xml;</p><p>using System.Net;</p><p>using System.Web;</p><p></p><p>namespace Apple_downloader</p><p>{</p><p> class Program</p><p> {</p><p> static void Main(string[] args)</p><p> {</p><p> //Load settings</p><p> XmlDocument doc_settings = new XmlDocument();</p><p> doc_settings.Load(System.IO.Directory.GetCurrentDirectory() + "\\settings.xml");</p><p> XmlNodeList nodes_settings = doc_settings.SelectNodes("/settings");</p><p> string downloaddir = "";</p><p> string coverart = "";</p><p> string hd_option = "";</p><p> string normal_hres_option = "";</p><p> foreach (XmlNode node in nodes_settings)</p><p> {</p><p> //Download dirs</p><p> downloaddir = node.SelectSingleNode("save_location").InnerText;</p><p> coverart = node.SelectSingleNode("save_location_poster").InnerText;</p><p> hd_option = node.SelectSingleNode("HD").InnerText;</p><p> normal_hres_option = node.SelectSingleNode("normal_hres").InnerText;</p><p> }</p><p> //Feed locations</p><p> string feed_720p = "http://www.apple.com/trailers/home/xml/current_720p.xml";</p><p> string feed_normal = "http://www.apple.com/trailers/home/xml/current.xml";</p><p></p><p> //Read feeds</p><p> XmlDocument doc = new XmlDocument();</p><p> XmlDocument doc2 = new XmlDocument();</p><p> WebClient Client = new WebClient();</p><p> doc.Load(feed_normal);</p><p> doc2.Load(feed_720p);</p><p></p><p> if (normal_hres_option == "1")</p><p> {</p><p> //Normal high-res trailers</p><p> XmlNodeList nodes_normal = doc.SelectNodes("/records/movieinfo");</p><p> foreach (XmlNode node in nodes_normal)</p><p> {</p><p> string preview = node.SelectSingleNode("preview").InnerText.ToString();</p><p> string title = node.SelectSingleNode("info/title").InnerText.ToString();</p><p> string poster = node.SelectSingleNode("poster/location").InnerText.ToString();</p><p> string folder_name = downloaddir + "\\" + title.Replace(":", " - ");</p><p> string mov_location = folder_name + "\\" + title.Replace(":", " - ") + "_hres.mov";</p><p> string poster_location = folder_name + "\\folder.jpg";</p><p></p><p> if (System.IO.File.Exists(mov_location) || System.IO.Directory.Exists(downloaddir + "\\" + title))</p><p> {</p><p> Console.WriteLine("Trailer for: " + title + " already downloaded");</p><p> }</p><p> else</p><p> {</p><p> Console.WriteLine("Processing trailer: " + title);</p><p> //Create movie folders</p><p> System.IO.Directory.CreateDirectory(folder_name);</p><p> //Client.DownloadFile(preview, mov_location);</p><p> Client.DownloadFile(poster, poster_location);</p><p> }</p><p> }</p><p> }</p><p> if (hd_option == "1")</p><p> {</p><p> //720p trailers</p><p> XmlNodeList nodes_720p = doc2.SelectNodes("/records/movieinfo");</p><p></p><p> foreach (XmlNode node in nodes_720p)</p><p> {</p><p> string preview = node.SelectSingleNode("preview").InnerText.ToString();</p><p> string title = node.SelectSingleNode("info/title").InnerText.ToString();</p><p> string poster = node.SelectSingleNode("poster/location").InnerText.ToString();</p><p> string folder_name = downloaddir + "\\" + title.Replace(":", " - ");</p><p> string mov_location = folder_name + "\\" + title.Replace(":", " - ") + "_720p.mov";</p><p> string poster_location = folder_name + "\\folder.jpg";</p><p> if (System.IO.File.Exists(mov_location) || System.IO.Directory.Exists(downloaddir + "\\" + title))</p><p> {</p><p> Console.WriteLine("Trailer for: " + title + " already downloaded");</p><p> }</p><p> else</p><p> {</p><p> Console.WriteLine("Processing trailer: " + title);</p><p> //Create movie folders</p><p> System.IO.Directory.CreateDirectory(folder_name);</p><p> Client.DownloadFile(preview, mov_location);</p><p> Client.DownloadFile(poster, poster_location);</p><p> }</p><p> }</p><p> }</p><p> }</p><p> }</p><p>}</p><p></p><p>[/code]</p><p></p><p>Compiled version:</p><p></p><p><a href="http://www.file-upload.net/download-1030890/Apple_downloader_v0.02.zip.html" target="_blank">http://www.file-upload.net/download-1030890/Apple_downloader_v0.02.zip.html</a></p><p></p><p>/edit2: little code cleanup , less .net needed library's now.</p></blockquote><p></p>
[QUOTE="Rick164, post: 291382, member: 17766"] Thanks for the script, gonna write one in c#(.net) with this as the example :) Will share it here when it's finished so that windows users can also use it. /edit: done, it's a console application with a config file for the folder locations. Here is the early code i have written, it checks if the folder or file already exists and has a settings.xml file for the folder locations and to select what version to download(hd or normal_hres): [code] using System; using System.Text; using System.IO; using System.Xml; using System.Net; using System.Web; namespace Apple_downloader { class Program { static void Main(string[] args) { //Load settings XmlDocument doc_settings = new XmlDocument(); doc_settings.Load(System.IO.Directory.GetCurrentDirectory() + "\\settings.xml"); XmlNodeList nodes_settings = doc_settings.SelectNodes("/settings"); string downloaddir = ""; string coverart = ""; string hd_option = ""; string normal_hres_option = ""; foreach (XmlNode node in nodes_settings) { //Download dirs downloaddir = node.SelectSingleNode("save_location").InnerText; coverart = node.SelectSingleNode("save_location_poster").InnerText; hd_option = node.SelectSingleNode("HD").InnerText; normal_hres_option = node.SelectSingleNode("normal_hres").InnerText; } //Feed locations string feed_720p = "http://www.apple.com/trailers/home/xml/current_720p.xml"; string feed_normal = "http://www.apple.com/trailers/home/xml/current.xml"; //Read feeds XmlDocument doc = new XmlDocument(); XmlDocument doc2 = new XmlDocument(); WebClient Client = new WebClient(); doc.Load(feed_normal); doc2.Load(feed_720p); if (normal_hres_option == "1") { //Normal high-res trailers XmlNodeList nodes_normal = doc.SelectNodes("/records/movieinfo"); foreach (XmlNode node in nodes_normal) { string preview = node.SelectSingleNode("preview").InnerText.ToString(); string title = node.SelectSingleNode("info/title").InnerText.ToString(); string poster = node.SelectSingleNode("poster/location").InnerText.ToString(); string folder_name = downloaddir + "\\" + title.Replace(":", " - "); string mov_location = folder_name + "\\" + title.Replace(":", " - ") + "_hres.mov"; string poster_location = folder_name + "\\folder.jpg"; if (System.IO.File.Exists(mov_location) || System.IO.Directory.Exists(downloaddir + "\\" + title)) { Console.WriteLine("Trailer for: " + title + " already downloaded"); } else { Console.WriteLine("Processing trailer: " + title); //Create movie folders System.IO.Directory.CreateDirectory(folder_name); //Client.DownloadFile(preview, mov_location); Client.DownloadFile(poster, poster_location); } } } if (hd_option == "1") { //720p trailers XmlNodeList nodes_720p = doc2.SelectNodes("/records/movieinfo"); foreach (XmlNode node in nodes_720p) { string preview = node.SelectSingleNode("preview").InnerText.ToString(); string title = node.SelectSingleNode("info/title").InnerText.ToString(); string poster = node.SelectSingleNode("poster/location").InnerText.ToString(); string folder_name = downloaddir + "\\" + title.Replace(":", " - "); string mov_location = folder_name + "\\" + title.Replace(":", " - ") + "_720p.mov"; string poster_location = folder_name + "\\folder.jpg"; if (System.IO.File.Exists(mov_location) || System.IO.Directory.Exists(downloaddir + "\\" + title)) { Console.WriteLine("Trailer for: " + title + " already downloaded"); } else { Console.WriteLine("Processing trailer: " + title); //Create movie folders System.IO.Directory.CreateDirectory(folder_name); Client.DownloadFile(preview, mov_location); Client.DownloadFile(poster, poster_location); } } } } } } [/code] Compiled version: [url]http://www.file-upload.net/download-1030890/Apple_downloader_v0.02.zip.html[/url] /edit2: little code cleanup , less .net needed library's now. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
MyTrailers
Contact us
RSS
Top
Bottom