1

I am working on a website. It is basically a movie database working with the help of IMDB. I I use images from their server, on localhost I'm able to display them. However, when I put the site on a live server, images are not shown.

I put a single image on different file for testing with this code:

<img src="http://ia.media-imdb.com/images/M/MV5BMTM3OTUyNTI3MF5BMl5BanBnXkFtZTcwODcyMzM0Mw@@._V1_SX300.jpg" style="width:100%;height:300px">

See this demo.

However, I am not able to view this image. With firebug, it does display image on debug window.

I replaced this image with another image, and I can see that image normally. So: why is the previous IMDB image not shown?

Can anyone point out what I'm missing?

Jeroen
  • 60,696
  • 40
  • 206
  • 339
Gautam Menariya
  • 546
  • 2
  • 7
  • 27
  • Are you using AdBlock Plus? – Onion Jul 06 '14 at 11:21
  • 1
    "With the help of IMDB"? Do they help you voluntarily or is that just a way of saying "I leech content from IMDB"? – JJJ Jul 06 '14 at 11:21
  • I am able to see the image in your website. Also, I wouldn't recommend stealing image data from IMDB. As far as I'm aware, they do not provide a public API for such things. – Onion Jul 06 '14 at 11:22
  • 2
    Check the network tab, the image causes a 403. I think you should read the terms of IMDB ;) – Jeroen Jul 06 '14 at 11:23
  • ok, I understand that leeching from IMDB is not a good thing. Ill change the process. But why is works on localhost? – Gautam Menariya Jul 06 '14 at 11:26

2 Answers2

2

You get a 403 response for the image, this means IMDB says it's forbidden to use images like that. You should probably check their Terms. I'm not a lawyer though, consult one if you think you need one.

The reason you don't get one locally can only be speculated to: it's going to be due to the logic they have in place for determining whether you can grab the image or not. My guess would be that their logic can't reliably distinguish your site running locally and just a regular browser request for the image (e.g. when you're browsing imdb.com).

Jeroen
  • 60,696
  • 40
  • 206
  • 339
1

Simple answer: IMDb does not allow image hotlinking.

When you request the file from the server end, it detects it and blocks your request.

enter image description here

Cai
  • 3,609
  • 2
  • 19
  • 39