def file_check(self):
urls = ["https://images-2.discordapp.net/.eJwNwcENwyAMAMBdGABDCWCyDSKIoCYxwuZVdff27qPWvNSuTpHBO8DRudA8NAvN3Kp"
"uRO2qeXTWhW7IIrmcd32EwQbjMCRMaJNxPmwILxcRg_9Da_yWYoQ3dV5z6fE09f0BC6EjAw.B0sII_QLbL9kJo6Zbb4GuO4MQNw",
"https://cdn.discordapp.com/attachments/218222973557932032/240223136447070208/FortuneCookieNF.ttf"]
option = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0)'
' Gecko/20100101 Firefox/40.1'}
if os.path.exists("data/horoscope/cookie.png"):
async with aiohttp.request("GET", urls[0], headers=option) as resp:
test = await resp.read()
meow = False
with open("data/horoscope/cookie.png", "rb") as e:
if len(test) != len(e.read()):
meow = True
if meow:
with open("data/horoscope/cookie.png", "wb") as f:
f.write(test)
elif not os.path.exists("data/horoscope/cookie.png"):
async with aiohttp.request("GET", urls[0], headers=option) as resp:
test = await resp.read()
with open("data/horoscope/cookie.png", "wb") as f:
f.write(test)
if not os.path.exists("data/horoscope/FortuneCookieNF.ttf"):
async with aiohttp.request("GET", urls[1], headers=option) as resp:
test = await resp.read()
with open("data/horoscope/FortuneCookieNF.ttf", "wb") as f:
f.write(test)
评论列表
文章目录