So I’m fetching information from http://www.omdbapi.com/
When I receive the info, there is a field “Poster” with an URL to the poster of the image.
And I do something like:
$box.html(
'<div class="large_movie_info_box">' +
'<img alt="poster" src="' + e.imdb.Poster + '"/>' +
'</div>'
);
I can fetch it if I visit my website from localhost/path/bla
but if I visit it from my domain I cant get the error:
GET http://ia.media-imdb.com/images/M/MV5BMTIwOTE4MTU4MV5BMl5BanBnXkFtZTcwMDk1MDU1MQ@@._V1_SX300.jpg 403 (Forbidden)
Is there any way around this?
When you link a picture from another site in your own site, you need to make sure that such site explicitly allows you to do so. Bandwidth costs money and most sites are not willing to pay for third-party sites expenses. In the case of IMDB, it’s clear that they disallow it, given that they’ve implemented countermeasures to avoid it.
You’ll have to download every image (once) into your hosting space using a server side technology that allows to do so (e.g. PHP) and link it from there. That way, you’ll be the one paying the bills 😉
Apart from that, there’s the copyright issue. Make sure you review IMDB’s terms of use in order to know if you’re allowed to use their pictures.