This repository has been archived on 2026-08-27. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
RequestCounter/app/db/__init__.py
T
2022-04-11 21:49:36 +08:00

29 lines
535 B
Python

#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/3/25
# @File Name: __init__.py.py
import os
import sys
import requests
def download():
res = requests.get('https://filebase.vercel.app/download/data.db')
with open('./app/db/data.sqlite', 'wb') as fp:
fp.write(res.content)
if not os.path.exists('./app/db/data.sqlite'):
try:
download()
except requests.exceptions as error:
sys.exit(1)
__all__ = [
'db'
]