cast and genre cleanup

This commit is contained in:
j 2010-04-08 11:52:44 +02:00
parent ef49aae822
commit f3eaf4404f

View file

@ -84,7 +84,8 @@ def getMovieInfo(imdbId, timeout=-1):
for i in re.compile('<h5>(.*?):</h5>(.*?)<div class="info"', re.DOTALL).findall(data):
title = stripTags(i[0]).strip().lower()
if title in ('genre', ):
txt = i[1].split('</div>')[0]
txt = i[1].split('<a class="tn15more')[0].split('</div>')[0]
print txt
else:
txt= i[1]
txt = stripTags(txt).strip()
@ -277,7 +278,8 @@ def getMovieCredits(imdbId):
data = readUrlUnicode(url)
groups = data.split('<h5>')
for g in groups:
section = re.compile('''name="(.*?)".*? href="/Glossary''').findall(g)
#<a class="glossary" name="writers" href="/glossary/W#writer">Writing credits</a>
section = re.compile('''name="(.*?)".*? href="/Glossary''', re.IGNORECASE).findall(g)
if section:
credits[section[0]] = creditList(g, section[0])
return credits