Archived
feat: upload
This commit is contained in:
20 files changed
+112
-75
No files matched your search
Binary file not shown.
+40
-15
File diff suppressed because one or more lines are too long.
@@ -16,7 +16,7 @@ def convert() -> None:
|
||||
# image转base64
|
||||
lst = []
|
||||
for i in range(10):
|
||||
with open(f'../../static/number/{i}.png', 'rb') as f:
|
||||
with open(f'../../static/theme/t2/{i}.svg', 'rb') as f:
|
||||
base64_data = base64.b64encode(f.read())
|
||||
base64_code = 'data:image/jpeg;base64,' + base64_data.decode('utf-8')
|
||||
lst.append(base64_code)
|
||||
|
||||
+24
-4
@@ -8,7 +8,27 @@
|
||||
import requests
|
||||
import random
|
||||
|
||||
name_str = random.sample(range(1, 100), 30)
|
||||
for i in name_str:
|
||||
resp = requests.get(f'http://127.0.0.1:8000/API?owner={i}')
|
||||
print(resp.content)
|
||||
|
||||
def request_test() -> None:
|
||||
"""
|
||||
请求测试
|
||||
:return:
|
||||
"""
|
||||
name_str = random.sample(range(1, 100), 30)
|
||||
for i in name_str:
|
||||
resp = requests.get(f'http://127.0.0.1:8000/API?owner={i}')
|
||||
print(resp.content)
|
||||
|
||||
|
||||
def download_test() -> None:
|
||||
"""
|
||||
下载测试
|
||||
:return:
|
||||
"""
|
||||
|
||||
resp = requests.get('https://count.getloli.com/get/@Moe-counter.github')
|
||||
with open('download_test.html', 'wb') as fp:
|
||||
fp.write(resp.content)
|
||||
|
||||
|
||||
download_test()
|
||||
Reference in New Issue
Block a user