more raw regexp strings
This commit is contained in:
parent
29a309f15e
commit
ae10c5c9b9
11 changed files with 45 additions and 45 deletions
|
|
@ -81,36 +81,36 @@ def get_movie_data(wikipedia_url):
|
|||
if 'amg_id' in filmbox and not filmbox['amg_id'].isdigit():
|
||||
del filmbox['amg_id']
|
||||
if 'Allmovie movie' in data:
|
||||
filmbox['amg_id'] = find_re(data, 'Allmovie movie\|.*?(\d+)')
|
||||
filmbox['amg_id'] = find_re(data, r'Allmovie movie\|.*?(\d+)')
|
||||
elif 'Allmovie title' in data:
|
||||
filmbox['amg_id'] = find_re(data, 'Allmovie title\|.*?(\d+)')
|
||||
filmbox['amg_id'] = find_re(data, r'Allmovie title\|.*?(\d+)')
|
||||
|
||||
if 'Official website' in data:
|
||||
filmbox['website'] = find_re(data, 'Official website\|(.*?)}').strip()
|
||||
filmbox['website'] = find_re(data, r'Official website\|(.*?)}').strip()
|
||||
|
||||
r = re.compile('{{IMDb title\|id=(\d{7})', re.IGNORECASE).findall(data)
|
||||
r = re.compile(r'{{IMDb title\|id=(\d{7})', re.IGNORECASE).findall(data)
|
||||
if r:
|
||||
filmbox['imdb_id'] = r[0]
|
||||
else:
|
||||
r = re.compile('{{IMDb title\|(\d{7})', re.IGNORECASE).findall(data)
|
||||
r = re.compile(r'{{IMDb title\|(\d{7})', re.IGNORECASE).findall(data)
|
||||
if r:
|
||||
filmbox['imdb_id'] = r[0]
|
||||
|
||||
r = re.compile('{{Internet Archive.*?\|id=(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
r = re.compile(r'{{Internet Archive.*?\|id=(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
if r:
|
||||
filmbox['archiveorg_id'] = r[0]
|
||||
|
||||
r = re.compile('{{mojo title\|(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
r = re.compile(r'{{mojo title\|(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
if r:
|
||||
filmbox['mojo_id'] = r[0].replace('id=', '')
|
||||
|
||||
r = re.compile('{{rotten-tomatoes\|(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
r = re.compile(r'{{rotten-tomatoes\|(.*?)[\|}]', re.IGNORECASE).findall(data)
|
||||
if r:
|
||||
filmbox['rottentomatoes_id'] = r[0].replace('id=', '')
|
||||
if 'google video' in data:
|
||||
filmbox['google_video_id'] = find_re(data, 'google video\|.*?(\d*?)[\|}]')
|
||||
filmbox['google_video_id'] = find_re(data, r'google video\|.*?(\d*?)[\|}]')
|
||||
if 'DEFAULTSORT' in data:
|
||||
filmbox['title_sort'] = find_re(data, '''\{\{DEFAULTSORT:(.*?)\}\}''')
|
||||
filmbox['title_sort'] = find_re(data, r'''\{\{DEFAULTSORT:(.*?)\}\}''')
|
||||
return filmbox
|
||||
|
||||
def get_image_url(name):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue