not all archive.org links have a title

This commit is contained in:
j 2012-01-13 19:37:12 +05:30
parent fdbf18980f
commit f3787c7412

View file

@ -51,7 +51,8 @@ def getWikiData(wikipediaUrl):
return data return data
def getMovieData(wikipediaUrl): def getMovieData(wikipediaUrl):
if not wikipediaUrl.startswith('http'): wikipediaUrl = getUrl(wikipediaUrl) if not wikipediaUrl.startswith('http'):
wikipediaUrl = getUrl(wikipediaUrl)
data = getWikiData(wikipediaUrl) data = getWikiData(wikipediaUrl)
filmbox_data = findRe(data, '''\{\{[Ii]nfobox.[Ff]ilm(.*?)\n\}\}''') filmbox_data = findRe(data, '''\{\{[Ii]nfobox.[Ff]ilm(.*?)\n\}\}''')
filmbox = {} filmbox = {}
@ -80,7 +81,7 @@ def getMovieData(wikipediaUrl):
if r: if r:
filmbox['imdb_id'] = r[0] filmbox['imdb_id'] = r[0]
r = re.compile('{{Internet Archive.*?\|id=(.*?)\|', re.IGNORECASE).findall(data) r = re.compile('{{Internet Archive.*?\|id=(.*?)[\|}]', re.IGNORECASE).findall(data)
if r: if r:
filmbox['archiveorg_id'] = r[0] filmbox['archiveorg_id'] = r[0]