stills
This commit is contained in:
parent
2663c29e6b
commit
fd24107260
1 changed files with 16 additions and 1 deletions
|
@ -249,6 +249,7 @@ class IMDb:
|
|||
IMDbDict['release_date'] = self.parseReleaseinfo()
|
||||
IMDbDict['business'] = self.parseBusiness()
|
||||
IMDbDict['reviews'] = self.parseExternalreviews()
|
||||
IMDbDict['stills'] = getMovieStills(self.imdb)
|
||||
#IMDbDict['trailer'] = self.parseTrailer()
|
||||
self.IMDbDict = IMDbDict
|
||||
|
||||
|
@ -559,6 +560,20 @@ def getEpisodeData(title, episode, show_url = None):
|
|||
episodeData['imdb'] = i['episodes'][episode]['imdb']
|
||||
return episodeData
|
||||
|
||||
def getMovieStills(id):
|
||||
data = read_url("http://imdb.com/gallery/ss/%s" % id)
|
||||
s_ = re.compile('''<img width="(\d*?)" height="(\d*?)" src="http://i.imdb.com/Photos/Ss/%s/th-(.*?).jpg"''' % id).findall(data)
|
||||
stills = []
|
||||
for s in s_:
|
||||
if int(s[0]) > int(s[1]):
|
||||
stills.append("http://i.imdb.com/Photos/Ss/%s/%s.jpg" % (id, s[2]))
|
||||
if not stills:
|
||||
s_ = re.compile('''<img width="(\d*?)" height="(\d*?)" src="http://(.*?)p.jpg"''').findall(data)
|
||||
stills = []
|
||||
for s in s_:
|
||||
if int(s[0]) > int(s[1]):
|
||||
stills.append("http://%sf.jpg" % s[2])
|
||||
return stills
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
|
|
Loading…
Reference in a new issue