fix votes in IMDb
This commit is contained in:
parent
ba14fc371a
commit
9fab130d81
1 changed files with 2 additions and 5 deletions
|
@ -565,6 +565,7 @@ class IMDb:
|
||||||
def parse(self):
|
def parse(self):
|
||||||
data = self.getPage()
|
data = self.getPage()
|
||||||
IMDbDict ={}
|
IMDbDict ={}
|
||||||
|
info = getMovieInfo(self.imdb)
|
||||||
#Poster
|
#Poster
|
||||||
IMDbDict['poster'] = getMoviePoster(self.imdb)
|
IMDbDict['poster'] = getMoviePoster(self.imdb)
|
||||||
if not IMDbDict['poster']:
|
if not IMDbDict['poster']:
|
||||||
|
@ -580,11 +581,7 @@ class IMDb:
|
||||||
else:
|
else:
|
||||||
IMDbDict['rating'] = -1
|
IMDbDict['rating'] = -1
|
||||||
#Votes
|
#Votes
|
||||||
m = re.compile('<small>\(<a href="ratings">(.*?) votes</a>\)</small>', re.IGNORECASE).findall(data)
|
IMDbDict['votes'] = info['votes']
|
||||||
if m:
|
|
||||||
IMDbDict['votes'] = int(m[0].replace(',', ''))
|
|
||||||
else:
|
|
||||||
IMDbDict['votes'] = -1
|
|
||||||
|
|
||||||
data = data.replace('\n',' ')
|
data = data.replace('\n',' ')
|
||||||
#some values
|
#some values
|
||||||
|
|
Loading…
Reference in a new issue