update geo module
This commit is contained in:
parent
790e0c4500
commit
4da93006fc
6 changed files with 29 additions and 17 deletions
|
|
@ -149,11 +149,11 @@ def get_country_data(country):
|
|||
file = DATA['flag'][name] if DATA['flag'][name][-4:] == '.png' else DATA['flag'][name] + '.svg'
|
||||
country['flagURL'] = get_flag('File:' + file)
|
||||
else:
|
||||
match = re.search('vertical-align:middle;?"( align="center")?><a href="/wiki/(File:.*?)"', html)
|
||||
match = re.search('width:58%; vertical-align:middle;?"( align="center")?><a href="/w/index\.php\?title=(File:.*?)(&page=1)?"', html)
|
||||
if not match:
|
||||
match = re.search('"/wiki/(File:Flag_.*?\.svg)"', html)
|
||||
match = re.search('"/w/index\.php\?title=(File:Flag_.*?\.svg)(&page=1)?"', html)
|
||||
if match:
|
||||
country['flagURL'] = get_flag(match.group(len(match.groups())))
|
||||
country['flagURL'] = get_flag(match.group(len(match.groups()) - 1))
|
||||
# google
|
||||
if name in DATA['google']:
|
||||
country['googleName'] = DATA['google'][name]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue