Update lx_script.py

Fix display error in generated `lx-music-source-example.js` file by set encoding.
This commit is contained in:
Albert Lin 2024-01-07 14:20:51 +08:00 committed by GitHub
parent c286424e34
commit c37fc785b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ async def get_response(retry = 0):
async def get_script():
req = await get_response()
if (req.status == 200):
with open('./lx-music-source-example.js', 'w') as f:
with open('./lx-music-source-example.js', 'w', encoding='utf-8') as f:
f.write(req.text)
f.close()
logger.info('更新源脚本成功')