-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathpdisk.py
29 lines (27 loc) · 1.14 KB
/
pdisk.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
import requests as re
import json
def pdisk_url(api_key:str , link:str , title :str , thumb = None ):
if thumb :
data = { "api_key":api_key,
"content_src":link,
"link_type":"link",
"title": title,
"cover_url":thumb
}
res = re.post("http://linkapi.net/open/create_item",data).content
result = json.loads(res)
return result
else:
data = { "api_key":api_key,
"content_src":link,
"link_type":"link",
"title": title ,
}
res = re.post('http://linkapi.net/open/create_item',data).content
result = json.loads(res)
return result
def api_check(api_key):
data = {"api_key":api_key}
res = re.get('http://linkapi.net/open/get_put_link',data).content
result = json.loads(res)
return result