Skip to content

Commit

Permalink
Update data_source.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier authored Aug 11, 2021
1 parent 218147b commit 109b80b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/yiqing/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ async def get_yiqing_data(area: str):
if area == '中国':
province = area
province_type = ""
elif area[-1] == '市' and area not in data.keys():
elif area in data.keys() and area[-1] != '市':
province = area if area[-1] != '省' else area[:-1]
if len(data[province]) == 1:
province_type = "市"
city = ""
else:
area = area[:-1] if area[-1] == '市' else area
for p in data.keys():
if area in data[p]:
province = p
city = area
elif area in data.keys():
province = area if area[-1] != '省' else area[:-1]
if len(data[province]) == 1:
province_type = "市"
city = ""
if not province and not city:
return "小真寻只支持国内的疫情查询喔..."
async with aiohttp.ClientSession(headers=get_user_agent()) as session:
Expand Down

0 comments on commit 109b80b

Please sign in to comment.