-
Notifications
You must be signed in to change notification settings - Fork 2
/
WebFurApi.py
457 lines (452 loc) · 21.8 KB
/
WebFurApi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
import requests
import urllib
import hashlib
import os
import filetype
import json
def tuyaV1find_name(name):
findfriendurl = 'https://duo-api.turka.cn/tuyafriends/?name='
findfriendrequests = requests.get(findfriendurl+urllib.parse.quote(name)).text
return(findfriendrequests)
#是的就这么Get一下地址返回值就完事了(雾
def tuyaV1find_id(id):
findfriendurl = 'https://duo-api.turka.cn/tuyafriends/?id='
findfriendrequests = requests.get(findfriendurl+urllib.parse.quote(id)).text
return(findfriendrequests)
def tuyaV1img_id(id):
findimgurl = 'https://duo-api.turka.cn/tuyafriends/img/'+str(id)+'.png'
findimgrequests = requests.get(findimgurl).content
return(findimgrequests)
def tuyaV2find_name(name):
findfriendurl = 'https://duo-api-v2.turka.cn/tuyafriends/'
findfriendrequests = requests.get(findfriendurl+urllib.parse.quote(name)).text
return(findfriendrequests)
def tuyaV2find_img(name):
findfriendurl = 'https://duo-api-v2.turka.cn/tuyafriends/'
findfriendrequests = requests.get(findfriendurl+urllib.parse.quote(name)+'/img').content
findfriendfiletype = filetype.guess(findfriendrequests)
with open(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension,'wb') as f:
f.write(findfriendrequests)
string = str(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension).strip()
#string = string.replace('\\',"\"")
return(string)
def tuyaV3token(appid,appkey):
tokenurl = "https://qiduo-api.turka.cn/auth/token"
tokendata = {"appid":appid,"appkey":appkey}
#tokenheader = {"content-type":"application/json"}
#tokenrequests = requests.post(tokenurl,data=tokendata,headers=tokenheader)
tokenrequests = requests.post(tokenurl,data=tokendata)
#print(tokenrequests.text)
tokenjson = json.loads(tokenrequests.text)
#if os.path.exists(os.getcwd()+r'/tuyatokentemp.txt')==True:
#tokentemp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
#else:
#tokentemp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='w+')
tokentemp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='w+')
if str(tokenjson.get("status")) == "200":
print("TuyaToken:"+str(tokenjson.get("data").get("token")))
else:
print("TuyaToken(ERROR):"+str(tokenrequests.content))
tokentemp.write(tokenrequests.text)
tokentemp.close()
return tokenrequests.text
def tuyaV3find_name(appid,appkey,name):
findover = 0
findfriendurl = "https://qiduo-api.turka.cn/tuyafriends/"+str(name)
#findfriendurl = "http://210f07c0.nat123.fun:53138/tuyafriends/"+str(name)
while 3:
if os.path.exists(os.getcwd()+r'/tuyatokentemp.txt')==True:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
#print(tuyatokenjson)
#print(type(tuyatokenjson))
if tuyatokenjson.get("status") != 200:
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
tuyatokentmp.close()
findover = 1
break
else:
tuyaV3token(appid,appkey)
try:
tuyatokentmp.close()
except:
pass
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
if str(tuyatokenjson.get("status")) != "200" or findover != 1:
tuyatokentmp.close()
return json.dumps({"status":500,"tokenjson":tuyatokenjson,"apijson":""})
tuyatokentmp.close()
while 3:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
tuyatokenjson = json.loads(tuyatoken)
tuyatokenheader = {"Auth": "Bearer "+str(tuyatokenjson.get("data").get("token"))}
findfriendrequests = requests.get(findfriendurl,headers=tuyatokenheader)
#print(findfriendrequests.content)
findfriendjson = json.loads(findfriendrequests.content)
if str(findfriendjson.get("code")) == "1009":
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
findover = 2
break
if str(findfriendjson.get("code")) == "1009" or findover != 2:
tuyatokentmp.close()
return json.dumps({"status":501,"tokenjson":tuyatokenjson,"apijson":str(findfriendrequests.text)})
tuyatokentmp.close()
return findfriendrequests.content
def tuyaV3find_img_old(appid,appkey,name):
findover = 0
findfriendurl = "https://qiduo-api.turka.cn/tuyafriends/"+str(name)+"/img"
while 3:
if os.path.exists(os.getcwd()+r'/tuyatokentemp.txt')==True:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
if str(tuyatokenjson.get("status")) != "200":
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
tuyatokentmp.close()
findover = 1
break
else:
tuyaV3token(appid,appkey)
try:
tuyatokentmp.close
except:
pass
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
if str(tuyatokenjson.get("status")) != "200" or findover != 1:
tuyatokentmp.close()
return json.dumps({"status":500,"tokenjson":tuyatokenjson,"apijson":""})
tuyatokentmp.close()
while 3:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
tuyatokenjson = json.loads(tuyatoken)
tuyatokenheader = {"Auth": "Bearer "+str(tuyatokenjson.get("data").get("token"))}
findfriendrequests = requests.get(findfriendurl,headers=tuyatokenheader)
#print(findfriendrequests.content)
try:
findfriendjson = json.loads(findfriendrequests.content)
if str(findfriendjson.get("code")) == "1009":
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
break
except:
findover = 2
break
if findover != 2:
tuyatokentmp.close()
return json.dumps({"status":501,"tokenjson":tuyatokenjson,"apijson":str(findfriendrequests.text)})
tuyatokentmp.close()
findfriendfiletype = filetype.guess(findfriendrequests.content)
with open(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension,'wb') as f:
f.write(findfriendrequests.content)
string = str(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension).strip()
#string = string.replace('\\',"\"")
return(string)
def tuyaV3find_img_new(appid,appkey,name,json_enabled):
findover = 0
if str(json_enabled).isdigit() == True:
json_enabled = int(json_enabled)
else:
return json.dumps({"status":502,"tokenjson":"","apijson":""})
findfriendurl = "https://qiduo-api.turka.cn/tuyafriends/"+str(name)+"/img"
#findfriendurl = "http://210f07c0.nat123.fun:53138/tuyafriends/"+str(name)+"/img"
while 3:
if os.path.exists(os.getcwd()+r'/tuyatokentemp.txt')==True:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
if str(tuyatokenjson.get("status")) != "200":
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
tuyatokentmp.close()
findover = 1
break
else:
tuyaV3token(appid,appkey)
try:
tuyatokentmp.close
except:
pass
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
#print(tuyatoken)
tuyatokenjson = json.loads(tuyatoken)
if str(tuyatokenjson.get("status")) != "200" or findover != 1:
tuyatokentmp.close()
return json.dumps({"status":500,"tokenjson":tuyatokenjson,"apijson":""})
tuyatokentmp.close()
"""
while 3:
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
tuyatokenjson = json.loads(tuyatoken)
tuyatokenheader = {"Auth": "Bearer "+str(tuyatokenjson.get("data").get("token"))}
findfriendrequests = requests.get(findfriendurl,headers=tuyatokenheader)
#print(findfriendrequests.content)
try:
findfriendjson = json.loads(findfriendrequests.content)
if str(findfriendjson.get("code")) == "1009":
tuyatokentmp.close()
tuyaV3token(appid,appkey)
else:
break
except:
findover = 2
break
"""
tuyatokentmp = open(os.getcwd()+r'/tuyatokentemp.txt', mode='r+')
tuyatoken = tuyatokentmp.read()
tuyatokenjson = json.loads(tuyatoken)
tuyatokenheader = {"Auth": "Bearer "+str(tuyatokenjson.get("data").get("token"))}
findfriendrequests = requests.get(findfriendurl,headers=tuyatokenheader)
findfriendjson = json.loads(findfriendrequests.content)
if str(findfriendjson.get("code")) == "0":
if json_enabled == 0:
tuyatokentmp.close()
findfriendrequests = requests.get(findfriendjson.get("data").get("img"),headers=tuyatokenheader)
print(findfriendjson.get("data").get("img"))
#print(findfriendrequests.content)
findfriendfiletype = filetype.guess(findfriendrequests.content)
#print(findfriendfiletype)
#print(findfriendfiletype.extension)
with open(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension,'wb') as f:
f.write(findfriendrequests.content)
string = str(os.getcwd()+r"\findfriendtmp."+findfriendfiletype.extension).strip()
#string = string.replace('\\',"\"")
return(string)
else:
return(findfriendrequests.content)
else:
return json.dumps({"status":501,"tokenjson":tuyatokenjson,"apijson":str(findfriendrequests.text)})
#if findover != 2:
#tuyatokentmp.close()
#return json.dumps({"status":501,"tokenjson":tuyatokenjson,"apierror":str(findfriendrequests.text)})
def findluoV4tantan_token(token,name):
#新的开始!
findluo_url = "https://findluo-api.turka.cn/tantan/"
findluo_header = {"Authorization": token}
findluo_respone = requests.get(findluo_url+str(name),headers=findluo_header)
findluo_json = json.loads(findluo_respone.text)
return findluo_json
def findluoV4tantan(appid,apikey,name):
#新的开始!
findluo_url = "https://findluo-api.turka.cn/tantan/"+str(name)
findluo_sign = findluoV4sign(appid,apikey,findluo_url,False)
findluo_header = {"Authorization": "Findluo "+appid+"-"+findluo_sign["signhex"]+"-"+findluo_sign["timestamp"]}
findluo_respone = requests.get(findluo_url,headers=findluo_header)
findluo_json = json.loads(findluo_respone.text)
return findluo_json
def findluoV4sign(appid,apikey,findluo_url,debug):
#v4正式版的签名!
now_timestamp = int(time.time() * 1000)
findluo_signstr = "Findluo\n" + str(now_timestamp) + "\n" + str(urlparse.urlparse(findluo_url).path) + "\n" + str(apikey)
findluo_signhex = hashlib.sha256(findluo_signstr.encode('utf-8')).hexdigest()
if debug == True:
print({"Appid": appid, "signstr": findluo_signstr,"signhex": findluo_signhex,"timestamp": str(now_timestamp)})
return {"Appid": appid, "signstr": findluo_signstr,"signhex": findluo_signhex,"timestamp": str(now_timestamp)}
def findluo2tuyafind(luojson):
#findluo与tuyafind的数据结构相似,通常情况下推荐使用新结构即可。
#本函数只补全和还原(合并)成TuYaFind数据结构
if luojson == type("str"):
luojson = json.loads(luojson)
tuyajson = {"code":0,"msg":"嘿嘿,找找找到啦!OwO","data":{"name":"yoshi","id":"114514","birthday":"1990-11-21","hometown":"Yoshi Land","animal":"dragon and turtle","cha":"uwu","likes":"IT","intro":"你好!这里是绿色耀西哇awa"}}
tuyajson["code"] = luojson['code']
tuyajson["status"] = luojson['status']
tuyajson['msg'] = luojson['message']
if "data" in luojson:
#tuyajson['data'] = luojson['data']
tuyajson['data']["name"] = luojson['data']['name']
tuyajson['data']["id"] = luojson['data']['id']
tuyajson['data']["birthday"] = luojson['data']["birthday"]
tuyajson['data']["hometown"] = luojson['data']["hometown"]
tuyajson['data']["animal"] = luojson['data']["animal"]
if "cha" in luojson:
tuyajson['data']["cha"] = luojson['data']["cha"]
else:
tuyajson['data']["cha"] = "呜,暂时不知道唔xwx"
if "likes" in luojson:
tuyajson['data']["likes"] = luojson['data']["likes"]
else:
tuyajson['data']["likes"] = "呜,暂时不知道唔xwx"
if "intro" in luojson:
tuyajson['data']["intro"] = luojson['data']["intro"]
else:
tuyajson['data']["intro"] = "呜,暂时不知道唔xwx"
tuyajson['data']["gender"] = luojson['data']['gender']
tuyajson['data']['keywords'] = luojson['data']['keywords']
if 'state' in luojson:
tuyajson['data']['state'] = luojson['data']['state']
else:
tuyajson['data']['state'] = 404
if "uid" in luojson:
tuyajson['data']['uid'] = luojson['data']['uid']
else:
tuyajson['data']["uid"] = 404
return tuyajson
def microtailV1random():
microtailurl = 'https://api.tail.icu/'
microtailurl = microtailurl+'api/v1/getFursuit/json'
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV1find_id(id):
microtailurl = 'https://api.tail.icu/'
microtailurl = microtailurl+'api/v1/getFursuitID/json?fid='+str(id)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV1random_img():
microtailurl = 'https://api.tail.icu/'
microtailurl = microtailurl+'api/v1/getFursuit/json'
microtailrequests = requests.get(microtailurl).content
microtailjson = json.loads(microtailrequests)
microtailimg = requests.get(microtailjson.get('data').get("url"))
microtailfiletype = filetype.guess(microtailimg.content)
with open(os.getcwd()+r"\microtailtmp."+microtailfiletype.extension,'wb') as f:
f.write(microtailimg.content)
string = str(os.getcwd()+r"\microtailtmp."+microtailfiletype.extension).strip()
#string = string.replace('\\',"\"")
return(string)
def microtailV1find_id_get_img(id):
microtailurl = 'https://api.tail.icu/'
microtailurl = microtailurl+'api/v1/getFursuitID/json?fid='+str(id)
microtailrequests = requests.get(microtailurl).content
microtailjson = json.loads(microtailrequests)
microtailimg = requests.get(microtailjson.get('data').get("url"))
microtailfiletype = filetype.guess(microtailimg.content)
with open(os.getcwd()+r"\microtailtmp."+microtailfiletype.extension,'wb') as f:
f.write(microtailimg.content)
string = str(os.getcwd()+r"\microtailtmp."+microtailfiletype.extension).strip()
#string = string.replace("\\","\"")
return(string)
def microtailV2random(qq,timestamp,authKey):
apipath = 'api/v2/getFursuitRand'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2find_id(qq,timestamp,authKey,id):
apipath = 'api/v2/getFursuitByID'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?fid='+str(id)+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2find_name(qq,timestamp,authKey,name):
apipath = 'api/v2/getFursuitByName'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?name='+str(urllib.parse.quote(name))+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2fid(qq,timestamp,authKey,name):
apipath = 'api/v2/getFursuitFid'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?name='+urllib.parse.quote(name)+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2fid_max(qq,timestamp,authKey,name):
apipath = 'api/v2/getFursuitMaxID'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?name='+urllib.parse.quote(name)+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2dayfur_random(qq,timestamp,authKey):
apipath = 'api/v2/DailyFursuit/Rand'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2dayfur_find_name(qq,timestamp,authKey,name):
apipath = 'api/v2/DailyFursuit/name'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?name='+urllib.parse.quote(name)+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2dayfur_find_id(qq,timestamp,authKey,id):
apipath = 'api/v2/DailyFursuit/id'
microtailurl = 'https://api.tail.icu/'+str(apipath)+'/?fid='+str(id)+'&qq='+str(qq)+'&sign='+str(microtailV2signstring(apipath,timestamp,authKey)) + '×tamp=' +str(timestamp)
microtailrequests = requests.get(microtailurl).text
return(microtailrequests)
def microtailV2signstring(apiPath,timestamp,authKey): #没写完(或者写寄了(2022.07.23:彳亍了,可以用了))
#def microtailV2signstring(apiPath,authKey):
#timestamp = int(time.time())
#furoriginal = int(str(apiPath)+'-'+str(timestamp)+'-'+str(authKey))
furoriginal = str(apiPath)+'-'+str(timestamp)+'-'+str(authKey)
print(furoriginal)
smallstring = hashlib.md5(furoriginal.encode(encoding='UTF-8')).hexdigest()
print(smallstring)
#furhash = int(hashlib.md5())
#print(furhash)
''' #是的,这一大堆完全用不到。。。。
#furoriginal = bytearray(furoriginal)
#furhash.update(furoriginal.encode("utf-8"))
#base64data=base64.b64encode(furhash.digest()).decode('utf-8')
#funbyte = int(bytes("".join(map(str,furhash.digest(bytearray(furoriginal))))), base=16)
#funbytearray = bytearray(furoriginal, 'utf-8')
#print(funbytearray)
#furhash.update(funbytearray)
#funhashdigest = furhash.digest()
#print(funhashdigest)
funbytes = bytes(funhashdigest)
print(funbytes)
#fun16byte = int(str(funbytes),base=16)
#fun16byte = hex(ord(funbytes))
fun16byte = hex(funbytes)
print(fun16byte)
if fun16byte == '' or fun16byte == 'null':
if len(fun16byte) > 1:
funreturn =int(bytes("".join(map(fun16byte))))
print(funreturn)
else:
funreturn = int(bytes("".join(map('0' + str(fun16byte)))))
print(funreturn)
else:
funreturn =int(bytes("".join(map(fun16byte))))
print(funreturn)
#funreturn = funbyte
return funreturn
'''
return smallstring
def furruiV2random_somebody(imgname,imgtype):
furruiurl = 'https://cloud.foxtail.cn/api/function/random?name='
if str(imgtype) == "":
furruirequests = requests.get(furruiurl+str(imgname)).text
else:
furruirequests = requests.get(furruiurl+str(imgname)+'&type='+str(imgtype)).text
return(furruirequests)
#Type类型 0.设定 1.毛图 2.插画 留空则全局
def furruiV2random():
furruiurl = 'https://cloud.foxtail.cn/api/function/random'
furruirequests = requests.get(furruiurl).text
return(furruirequests)
def furruiV2get_img(imgid):
furruiurl = 'https://cloud.foxtail.cn/api/function/pictures?picture=' + str(imgid)
furruirequests = requests.get(furruiurl).text
furruiurl = json.loads(furruirequests).get("url")
'''
furruiurl = 'https://cloud.foxtail.cn/api/function/obtain?mark='+json.loads(furruirequests).get("mark")
'''
furruiimg = requests.get(furruiurl).content
furruifiletype = filetype.guess(furruiimg)
with open(os.getcwd()+r"/furruitmp."+furruifiletype.extension,'wb') as f:
f.write(furruiimg)
string = str(os.getcwd()+r"/furruitmp."+furruifiletype.extension).strip()
#string = string.replace("\\","/")
return(string)
def hifurryV1today():
todayimgurl = 'https://api.hifurry.cn/everyfur/today.json'
todayimgrequests = requests.get(todayimgurl).text
return(todayimgrequests)
def hifurryV1find_day(time):
todayimgurl = 'https://api.hifurry.cn/everyfur/'+str(time)+'.json'
todayimgrequests = requests.get(todayimgurl).text
return(todayimgrequests)