allmovie: parse runtime
This commit is contained in:
parent
aee1085e35
commit
8c9647c28a
1 changed files with 2 additions and 1 deletions
|
@ -11,6 +11,7 @@ def getMovieData(allmovieId):
|
||||||
data = {}
|
data = {}
|
||||||
data['poster'] = findRe(html, '<img src="(http://image.*?)"')
|
data['poster'] = findRe(html, '<img src="(http://image.*?)"')
|
||||||
data['year'] = findRe(html, '<a href="/cg/avg.dll\?p=avg&sql=24:\d{4}">(\d{4})</a>')
|
data['year'] = findRe(html, '<a href="/cg/avg.dll\?p=avg&sql=24:\d{4}">(\d{4})</a>')
|
||||||
|
data['runtime'] = findRe(html, 'sql=24:\d{4}">.*?">(.*?)min.</td></tr></table>').strip()
|
||||||
data['rating'] = findRe(html, '" alt="(\d+?) Stars"')
|
data['rating'] = findRe(html, '" alt="(\d+?) Stars"')
|
||||||
data['country'] = findRe(html, '<a href="/cg/avg.dll\?p=avg&sql=24:D\|\|\|206">(.*?)</')
|
data['country'] = findRe(html, '<a href="/cg/avg.dll\?p=avg&sql=24:D\|\|\|206">(.*?)</')
|
||||||
data['director'] = stripTags(findRe(html, '<td class="formed-sub"><a href="/cg/avg.dll\?p=avg&sql=2:\d+">(.*?)</td>')).split(', ')
|
data['director'] = stripTags(findRe(html, '<td class="formed-sub"><a href="/cg/avg.dll\?p=avg&sql=2:\d+">(.*?)</td>')).split(', ')
|
||||||
|
@ -55,5 +56,5 @@ def parseList(html, title):
|
||||||
return map(lambda x: stripTags(x), findRe(html, '<span>%s</span>(.*?)</table>' % title).split('</li><li>'))
|
return map(lambda x: stripTags(x), findRe(html, '<span>%s</span>(.*?)</table>' % title).split('</li><li>'))
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
print getMovieData('177524')
|
print getMovieData('177524')['runtime']
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue