Given an IMDB movie id, how do I programmatically get its poster image?

前端 未结 17 690
礼貌的吻别
礼貌的吻别 2020-12-08 03:17

movie id tt0438097 can be found at http://www.imdb.com/title/tt0438097/

What\'s the url for its poster image?

相关标签:
17条回答
  • 2020-12-08 03:43

    You can use Trakt API, you have to make a search request with the imdb ID, and the Json result given by Trakt API contains links for two images of that movie (poster and fan art) http://trakt.tv/api-docs/search-movies

    0 讨论(0)
  • 2020-12-08 03:43

    Now a days, all modern browser have "Inspect" section:

    100% Correct for Google Chrome only:

    1. Take your cursor on image.
    2. Right click on it, select "Inspect Element".
    3. In the window appear, under Elements tab you will find the highlighted text as
    4. Just click on it.
    5. In the Resource tab, right click on image.
    6. Select "Copy image URL" option.

    Try to paste it any where as URL in any browser, you will only get the image.

    0 讨论(0)
  • 2020-12-08 03:44

    After playing around with @Hawk's BASE64 discovery above, I found that everything after the BASE64 code is display info. If you remove everything between the last @ and .jpg it will load the image in the highest res it has.

    https://m.media-amazon.com/images/M/MV5BMjAwODg3OTAxMl5BMl5BanBnXkFtZTcwMjg2NjYyMw@@._V1_UX182_CR0,0,182,268_AL_.jpg
    

    becomes

    https://m.media-amazon.com/images/M/MV5BMjAwODg3OTAxMl5BMl5BanBnXkFtZTcwMjg2NjYyMw@@.jpg
    
    0 讨论(0)
  • 2020-12-08 03:46
    $Title = $($Movie.Name)
    
    $searchTitle = $Title.Replace(' ','%20')  
    
    $moviesearch = Invoke-WebRequest "http://www.imdb.com/search/title?title=$searchTitle&title_type=feature"
    
    $titleclassarray = $moviesearch.AllElements | where Class -eq 'loadlate' | select -First 1
    
    $MoviePoster = $titleclassarray.loadlate
    
    0 讨论(0)
  • 2020-12-08 03:48

    If a thumb is enough, you can use the Facebook Graph API: http://graph.facebook.com/?ids=http://www.imdb.com/title/tt0438097/

    Gets you a thumbnail: http://profile.ak.fbcdn.net/hprofile-ak-ash2/50289_117058658320339_650214_s.jpg

    0 讨论(0)
  • 2020-12-08 03:52

    As I'm sure you know, the actual url for that image is

    http://ia.media-imdb.com/images/M/MV5BMTI0MDcxMzE3OF5BMl5BanBnXkFtZTcwODc3OTYzMQ@@._V1._SX100_SY133_.jpg

    You're going to be hard pressed to figure out how it's generated though and they don't seem to have a publicly available API.

    Screenscraping is probably your best bet.

    The picture seems to generally be inside a div with class=photo and the name of the a tag is poster.

    The image itself is just inside the a tag.

    0 讨论(0)
提交回复
热议问题