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
Development
Submit: code patches (MediaPortal/TV-Server/etc.)
Utils: DownLoadImage failed when PageRequest need Header "User-Agent"
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="morfius" data-source="post: 1096988" data-attributes="member: 116650"><p><strong><em>steps to reproduce the issue</em></strong></p><p>In configuration mode, select any Title from Database and go to CoverArt. Set the value of Image URL <em><a href="http://pics.filmaffinity.com/Carmina_o_revienta-570033301-large.jpg" target="_blank">http://pics.filmaffinity.com/Carmina_o_revienta-570033301-large.jpg</a></em> and Download Manually. You get the Error</p><p></p><p>LogError</p><p>[code] [2014-08-22 21:37:57,707] [Config ] [IMDBDetails] [INFO ] - Utils: DownLoadImage http://pics.filmaffinity.com/Carmina_o_revienta-570033301-large.jpg failed:The remote server returned an error: (403) Forbidden.</p><p>[/code]</p><p>Now open your Internet Browser and download it. The image is OK.</p><p></p><p>File Util.cs Routine DownLoadImage</p><p>[code]</p><p>public static void DownLoadImage(string strURL, string strFile, System.Drawing.Imaging.ImageFormat imageFormat)</p><p>...</p><p>using (WebClient client = new WebClient())</p><p>...</p><p>client.Proxy.Credentials = CredentialCache.DefaultCredentials;</p><p>client.DownloadFile(strURL, strLogo);</p><p>[/code]</p><p></p><p>Problem: some webs requires a header "User-Agent" (ex. FilmAffinity), but not all. IMDb don't work if you set the header "User-Agent".</p><p><strong>Solution:</strong></p><p>a) use a simple flag if (movieDetails.ThumbURL.Contains("filmaffinity")) client .Headers.Add("User-Agent", "Mozilla/"....</p><p>b) use (HttpWebRequest)WebRequest instead of WebClient</p><p>c) Team Media Portal have a lot of developpers with much more knowledge than me. In spanish <em>Doctores tiene la Iglesia</em> (translation from the Collins Dictionary <em>there are plenty of people well able to pass an opinion (on that)</em>)</p><p></p><p>Greetings from Spain</p><p></p><p>P.S. This is my first report, i hope post it in the correct place</p></blockquote><p></p>
[QUOTE="morfius, post: 1096988, member: 116650"] [b][i]steps to reproduce the issue[/i][/b] In configuration mode, select any Title from Database and go to CoverArt. Set the value of Image URL [i][url]http://pics.filmaffinity.com/Carmina_o_revienta-570033301-large.jpg[/url][/i] and Download Manually. You get the Error LogError [code] [2014-08-22 21:37:57,707] [Config ] [IMDBDetails] [INFO ] - Utils: DownLoadImage http://pics.filmaffinity.com/Carmina_o_revienta-570033301-large.jpg failed:The remote server returned an error: (403) Forbidden. [/code] Now open your Internet Browser and download it. The image is OK. File Util.cs Routine DownLoadImage [code] public static void DownLoadImage(string strURL, string strFile, System.Drawing.Imaging.ImageFormat imageFormat) ... using (WebClient client = new WebClient()) ... client.Proxy.Credentials = CredentialCache.DefaultCredentials; client.DownloadFile(strURL, strLogo); [/code] Problem: some webs requires a header "User-Agent" (ex. FilmAffinity), but not all. IMDb don't work if you set the header "User-Agent". [B]Solution:[/B] a) use a simple flag if (movieDetails.ThumbURL.Contains("filmaffinity")) client .Headers.Add("User-Agent", "Mozilla/".... b) use (HttpWebRequest)WebRequest instead of WebClient c) Team Media Portal have a lot of developpers with much more knowledge than me. In spanish [I]Doctores tiene la Iglesia[/I] (translation from the Collins Dictionary [I]there are plenty of people well able to pass an opinion (on that)[/I]) Greetings from Spain P.S. This is my first report, i hope post it in the correct place [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
Submit: code patches (MediaPortal/TV-Server/etc.)
Utils: DownLoadImage failed when PageRequest need Header "User-Agent"
Contact us
RSS
Top
Bottom