Davide Alberani | 3 Nov 2008 17:11
Picon
Gravatar

IMDbPY 3.8

Without fear to compete in popularity with the American vote,
I've released IMDbPY 3.8!

The main news, is the support for BOTH SQLObject (default) and
SQLAlchemy.  SQLAlchemy is still in beta, so test it and help,
if you can.

As usual: http://imdbpy.sf.net/

Bye,
--

-- 
Davide Alberani <davide.alberani@...> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Andrew Kelley | 9 Nov 2008 07:52
Picon
Gravatar

Get a movie cover picture/thumbnail

Hello,

Thanks for IMDbPy, it is very useful.

Question:

How do you get the picture of a movie's cover, or a thumbnail of the
movie's cover?

Thanks,
Andy

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Davide Alberani | 9 Nov 2008 11:14
Picon
Gravatar

Re: Get a movie cover picture/thumbnail

On Nov 09, Andrew Kelley <superjoe30@...> wrote:

> Thanks for IMDbPy, it is very useful.

Hello, and thank you!

> How do you get the picture of a movie's cover, or a thumbnail of the
> movie's cover?

If present, the url is accessible through movie['cover url'].
Beware that it could be missing, so you must first test it with
something like:
   if 'cover url' in movie:
       ...

After that, you can use the urllib module to fetch the image itself.

To provide a complete example, something like that should do the trick:
  import urllib
  from imdb import IMDb

  ia = IMDb(#yourParameters)
  movie = ia.get_movie(#theMovieID)

  if 'cover url' in movie:
      urlObj = urllib.urlopen(movie['cover url'])
      imageData = urlObj.read()
      urlObj.close()
      # now you can save imageData in a file (open it in binary mode).

(Continue reading)

Andy Kelley | 9 Nov 2008 12:02
Picon
Gravatar

Re: Get a movie cover picture/thumbnail

This is great, thanks for your help!

On Sun, Nov 9, 2008 at 3:14 AM, Davide Alberani <davide.alberani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
On Nov 09, Andrew Kelley <superjoe30-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> Thanks for IMDbPy, it is very useful.

Hello, and thank you!

> How do you get the picture of a movie's cover, or a thumbnail of the
> movie's cover?

If present, the url is accessible through movie['cover url'].
Beware that it could be missing, so you must first test it with
something like:
  if 'cover url' in movie:
      ...

After that, you can use the urllib module to fetch the image itself.

To provide a complete example, something like that should do the trick:
 import urllib
 from imdb import IMDb

 ia = IMDb(#yourParameters)
 movie = ia.get_movie(#theMovieID)

 if 'cover url' in movie:
     urlObj = urllib.urlopen(movie['cover url'])
     imageData = urlObj.read()
     urlObj.close()
     # now you can save imageData in a file (open it in binary mode).

In the same way, a person's headshot is stored in person['headshot'].

Things to be aware of:
- covers and headshots are available only fetching the data from the
 web server (via the 'http' or 'mobile' data access systems), and not
 in the plain text data files ('sql' or 'local').
- using the images, you must respect the terms of the IMDb's policy;
 see http://imdbpy.sourceforge.net/docs/DISCLAIMER.txt
- the images you'll get will vary in size; you can use the python-imaging
 module to rescale them, if needed.

--
Davide Alberani <davide.alberani-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@...
https://lists.sourceforge.net/lists/listinfo/imdbpy-help
ori cohen | 11 Nov 2008 08:26
Picon

imdb id - how do i get that information quicker from the web ?

hi,

i made a little script to go over all the movies in the titles table and update their imdb ID, ignoring tv series and video games etc..
the list is 400,000 in size. its taking quite a while for each file to get the imdb id, because its taking it from the web.

is there a quicker way of doing that?
by getting a ready made sql table, csv file from someone ?
using threads?
configuring imdbpy ?
etc..

thanks.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@...
https://lists.sourceforge.net/lists/listinfo/imdbpy-help
Davide Alberani | 11 Nov 2008 10:04
Picon
Gravatar

Re: imdb id - how do i get that information quicker from the web ?

On Nov 11, ori cohen <orioric@...> wrote:

> i made a little script to go over all the movies in the titles table
> and update their imdb ID, ignoring tv series and video games etc..
> the list is 400,000 in size. its taking quite a while for each file
> to get the imdb id, because its taking it from the web.
> 
> is there a quicker way of doing that?

For sure there is, but please: don't do it.
A thing is using IMDbPY for a light-weighted usage (fetching a
movie/person ID here and there, when needed), another is exploiting
their web site to fetch every single movie page in the database.

See the links in http://imdbpy.sourceforge.net/docs/DISCLAIMER.txt
for an overview of IMDb's policies.

The movie/person/whateverIDs are not present in the plain text data
files distributed by IMDb, and so IMDbPY is forced to fabricate
them (and as you have noticed they don't match with the "real" imdbIDs
used by the IMDb web site); anyway, there's no real need to have a
complete map between titles and imdbIDs for personal usage.
Moreover, titles are changed/updated/fixed, and so the map will be
(partially) wrong in no time.

Thanks,
--

-- 
Davide Alberani <davide.alberani@...> [PGP KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane