fix votes in IMDb

This commit is contained in:
j 2009-05-31 20:12:43 +02:00
parent ba14fc371a
commit 9fab130d81

View file

@ -565,6 +565,7 @@ class IMDb:
def parse(self):
data = self.getPage()
IMDbDict ={}
info = getMovieInfo(self.imdb)
#Poster
IMDbDict['poster'] = getMoviePoster(self.imdb)
if not IMDbDict['poster']:
@ -580,11 +581,7 @@ class IMDb:
else:
IMDbDict['rating'] = -1
#Votes
m = re.compile('<small>\(<a href="ratings">(.*?) votes</a>\)</small>', re.IGNORECASE).findall(data)
if m:
IMDbDict['votes'] = int(m[0].replace(',', ''))
else:
IMDbDict['votes'] = -1
IMDbDict['votes'] = info['votes']
data = data.replace('\n',' ')
#some values