mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-01-14 14:20:58 +08:00
19 lines
606 B
Python
19 lines
606 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
import aiohttp
|
|
|
|
VERSION = 'v1.2.3'
|
|
|
|
|
|
async def check_update():
|
|
try:
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.get('https://api.github.com/repos/xfgryujk/blivechat/releases/latest') as r:
|
|
data = await r.json()
|
|
if data['name'] != VERSION:
|
|
print('New version available:', data['name'])
|
|
print(data['body'])
|
|
print('Download:', data['html_url'])
|
|
except aiohttp.ClientConnectionError:
|
|
print('Failed to check update: connection failed')
|