better impawards module
This commit is contained in:
parent
8e9d0e8304
commit
2fe6a9e989
1 changed files with 15 additions and 1 deletions
|
@ -38,7 +38,21 @@ def parseArchivePage(html):
|
||||||
def parseMoviePage(html):
|
def parseMoviePage(html):
|
||||||
data = {}
|
data = {}
|
||||||
data['imdbId'] = findRe(html, 'imdb.com/title/tt(.*?) ')
|
data['imdbId'] = findRe(html, 'imdb.com/title/tt(.*?) ')
|
||||||
data['posterUrl'] = 'http://impawards.com/%s' % findRe(html, '<td align=center><br><img SRC="(.*?)"')
|
data['title'] = findRe(html, '<font size=\+3>(.*?) \(')
|
||||||
|
data['year'] = findRe(html, '\(<a href="eligible.html">(.*?)</a>\)')
|
||||||
|
result = findRe(html, '<a href = (\w*?_xlg.html) target= _blank>')
|
||||||
|
if result:
|
||||||
|
url = 'http://impawards.com/%s/%s' % (data['year'], result)
|
||||||
|
html = getUrlUnicode(url, timeout = -1)
|
||||||
|
d = parsePosterPage(html, data['year'])
|
||||||
|
data['posterUrl'] = d['posterUrl']
|
||||||
|
else:
|
||||||
|
data['posterUrl'] = 'http://impawards.com/%s/%s' % (data['year'], findRe(html, '<td align=center><br><img SRC="(.*?)"'))
|
||||||
|
return data
|
||||||
|
|
||||||
|
def parsePosterPage(html, year):
|
||||||
|
data = {}
|
||||||
|
data['posterUrl'] = 'http://impawards.com/%s/%s' % (year, findRe(html, '<img SRC="(.*?)"'))
|
||||||
return data
|
return data
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue