<p>来自IMDbPy邮件列表的响应:</p>
<blockquote>
<p>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:<br/>
if 'cover url' in movie:
...</p>
<p>After that, you can use the urllib
module to fetch the image itself.</p>
<p>To provide a complete example,
something like that should do the
trick:</p>
<pre><code>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).
</code></pre>
<p>In the same way, a person's headshot
is stored in person['headshot'].</p>
<p>Things to be aware of:</p>
<ul>
<li>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').</li>
<li>using the images, you must respect the terms of the IMDb's policy; see <a href="http://imdbpy.sourceforge.net/docs/DISCLAIMER.txt" rel="nofollow noreferrer">http://imdbpy.sourceforge.net/docs/DISCLAIMER.txt</a></li>
<li>the images you'll get will vary in size; you can use the python-imaging module to rescale them, if needed.</li>
</ul>
</blockquote>