Page 1 of 2

[REL] MoviePosterDB (Poster download)

Posted: 2009-09-13 12:20:29
by Necrocter
Hi I'm new :p

Well I was playing with the script editor from ant and then I realize that it was really easy to make scripts (the debug tool it makes the things easy).

I'm not familiar with Delphi so maybe my script is ugly and has a lot of bugs, but it works :D. The API from movieposterdb makes the thing easy too, you don't need to parse a complicate page to get the images.

The posters are not too big because the api doesn't let it, but the nice thing from this page is that I found a lot of rare movies.

It's preferably to have the imdb url in the URL field because if you use the names to get the covers the api will get the first movie that it will find with that name.

If someone could get an API key from TMDB (http://www.themoviedb.org/), I have time to make the script and it has bigger images.

Code: Select all

(***************************************************

Ant Movie Catalog importation script
www.antp.be/software/moviecatalog/

[Infos]
Authors=Necrocter
Title=MoviePosterDB
Description=Download posters from MoviePosterDB
Site=www.movieposterdb.com
Language=?
Version=0.1
Requires=3.5.1
Comments=Maybe some bugs will appear, let me know it.
License=This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation
GetInfo=1

[Options]

***************************************************)

program MoviePosterDB;
uses
  StringUtils1;
var
  IMDB: string;  // storage the imdb number
  MovieName: string;  // storage the movie name
  
const
  // the maximum width of the image permitted by the API is 300
  // I will change the script to use the properties to let the users
  // change the value of the width between 30 and 300
  IMDBURL = 'http://api.movieposterdb.com/json.inc.php?width=300&imdb=';
  MOVIEURL = 'http://api.movieposterdb.com/json.inc.php?width=300&title=';


// Removes all the info about the movie and the '\' from
// the image url
procedure AnalyzePage(Address: string);
var
   PageText: string;
   Value: string;
begin
  PageText := GetPage(Address);
  
  if Pos('{"errors":["No parameters found..."]}', PageText) > 0 then
    begin
      ShowMessage('No movie found for this search');
      Exit;
    end

  Value := TextBetween(PageText, '"imageurl":"', '"}');
  Value := StringReplace(Value, '\', '');
  GetPicture(Value);
end;
   
   

  
//** The main rutine **/
begin
  if CheckVersion(3,5,0) then
    begin
      IMDB := '';
      IMDB := GetField(fieldURL);
      if Pos('imdb.com', IMDB) > 0  then
        begin
          IMDB := TextAfter(IMDB, 'title/tt');
          AnalyzePage(IMDBURL + IMDB);
        end
      else
        begin
          MovieName := GetField(fieldOriginalTitle);
          if MovieName = '' then
            MovieName := GetField(fieldTranslatedTitle);
          Input('Import cover from movieposterdb', 'Enter the title of the movie:', MovieName);
          AnalyzePage(MOVIEURL + UrlEncode(MovieName));
        end
    end
  else
    ShowMessage('This script requires a newer version of Ant Movie Catalog (at least the version 3.5.0)');
end.

Posted: 2009-09-13 14:45:20
by antp
Thanks

No Longer works

Posted: 2010-10-11 10:42:33
by sajal
This has stopped working
As of September 27th we stopped our anonymous API (the json.inc.php and image.inc.php files). If you were a user of one of these and want to continue using posters from MoviePosterDB on your own site/app, you can request an API key by contacting us. In your request, please tell us who you are and what application/website you want to use the API for.
Can antp request for an api and make this working please, this used to work wonderfully previously

Posted: 2010-10-11 12:07:19
by antp
What do they use now? Do you know what is required exactly for doing requests/searches? (to know if AMC's script engine has what is needed)

The one who makes the script can also make the request, since it is him who actually writes the "program" who accesses to the site (i.e. the script)
I can do the request if I know what to ask, but since it is not me who will use it after that, I won't ask it "for nothing".

Posted: 2010-10-19 19:49:57
by SirMaggot
Here is a message on the page,

"Notice!
As of September 27th we stopped our anonymous API (the json.inc.php and image.inc.php files). If you were a user of one of these and want to continue using posters from MoviePosterDB on your own site/app, you can request an API key by contacting us. In your request, please tell us who you are and what application/website you want to use the API for."

Posted: 2010-10-20 05:55:29
by sajal
antp wrote:What do they use now? Do you know what is required exactly for doing requests/searches? (to know if AMC's script engine has what is needed)

The one who makes the script can also make the request, since it is him who actually writes the "program" who accesses to the site (i.e. the script)
I can do the request if I know what to ask, but since it is not me who will use it after that, I won't ask it "for nothing".
thanks for your response antp, but I don't know if Necrocter will ever read the forums (looking at his only 1 forum post)..

I just requested you to request for the api with movieposterdb, because you will request it for ant movie catalog, but I understand since it will be visible and can be misused by users elsewhere ...

However I used to use this script a lot, and feel sad about its unavailability.

Posted: 2010-10-20 08:30:26
by antp
We just have to hope that someone takes time to update the script. I would do it if I had time, since the site seems good.

Posted: 2010-10-24 18:17:52
by Necrocter
Ok, I requested the api-key, I will update the script as soon as I get one :)

Greets.

Posted: 2010-10-25 17:18:38
by SirMaggot
Great news, i use this script all the time, its awesome :grinking:

Posted: 2010-11-01 21:53:49
by Necrocter
I still waiting an answer, but I doubt they will answer :(.

Posted: 2010-11-04 20:18:20
by SirMaggot
Thanks a lot for trying :clapping:

Posted: 2010-11-19 10:32:50
by daws0n
I tried as well about a month ago. No reply either :(

On the posterdb website, you can access a movie's poster page directly via it's imdb code. So, rather than deciphering any search result pages a simple parsing of the IMDB link gets you the right result. E.g

Wayne's World IMDB link

http://imdb.com/title/tt0105793

Wayne's World Poster DB Link

http://www.movieposterdb.com/movie/0105793

In know very little about scripting, so as a somewhat crude work around I've been exporting the imdb urls of the movies I want posters for into a CSV file. Modifying the urls as above using open office, then saving the results to a html file. Opening this in my browser at least gives me a quick list of links for the posters wanted. From here, it's just a matter of copying the desired image source's URL into the clipboard and pasting it into AMC's "select a picture (shit f7)" dialog box.


It's still all rather cumbersome, but it's a damn sight quicker than doing it all "by hand". I hope they get you an API key, your script was really useful!

Posted: 2010-11-23 10:52:04
by sajal
Here's a console from which we can manually get the poster max 300 dimension, can anybody crawl and get the poster, the api key changes but I hope that script can automate it too

http://api.movieposterdb.com/console

Posted: 2010-12-12 12:25:33
by daws0n
Well that's a surprise, just checked my spam box and I've had a message back from the site complete with an API key!

I'll PM you the code Necrocter, hopefully you can do something with it :cool:

Posted: 2010-12-12 12:32:35
by daws0n
Not sure whether to post the code on here, but it will essentially be made public inside the script source anyway... What do you think antp?
Your new API key/secret combi is:

antmovcat / xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx. (censored for now)

To generate request-specific secrets: you take the md5 hash of your secret key and imdb code (pasted behind each other directly). Of that hash you take a 12-character substring which starts at the 10th character. In PHP: $secret_key = substr(md5($secret . $imdb_code), 10, 12);

Let's see how this goes!

Posted: 2010-12-13 11:48:56
by antp
As AMC is open source, being in the program or in the script does not change much: it is still possible to see the key. I do not know if it is a problem or not, but I can't hide it anyway.
The MD5 may be another problem... since nothing is there to generate that in AMC's script engine.
They mention IMDB number, isn't there a title search? Or was the previous script using IMDB for title search?

Posted: 2010-12-13 12:00:18
by daws0n
I thought the MD5 generation maybe an issue... Can you see anyway around it?

AFAIK the previous script used the IMDB number for title search.

Posted: 2010-12-13 18:57:59
by antp
I could do something actually... if I make a PHP page on my server which returns the MD5 of an IMDB title, it solves two problems in one time:
- secret key stays secret
- no MD5 computing needed in the script

The only downside of this solution is that another program could use my server in the same way... but there is no solution without problem since the program is opensource.

Could you send me the key by e-mail then?

Posted: 2010-12-13 19:02:47
by daws0n
Sounds good! You got mail :)

Posted: 2010-12-13 20:27:30
by antp
Thanks, I'll check that tomorrow if I do not forget ;)