Update __init__.py

This commit is contained in:
HibiKier 2021-07-11 15:16:16 +08:00 committed by GitHub
parent d8a997e568
commit 2a6951426b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,6 +45,9 @@ async def update_image():
if os.path.exists(f'{IMAGE_PATH}/genshin/daily_material.png'):
os.remove(f'{IMAGE_PATH}/genshin/daily_material.png')
browser = await get_browser()
if not browser:
logger.warning('获取 browser 失败,请部署至 linux 环境....')
return False
url = 'https://genshin.pub/daily'
page = await browser.new_page()
await page.goto(url, wait_until='networkidle', timeout=10000)