update

swadhinbiswas committed 2 years ago
9435891
1 parent c20caf3
commit 9435891
2 files changed
+20 -12
Showing 2 changed files+20-12
▼README.md
+11-2
11
11
12
12
# Video sharing has never been easier
13
13
14
-<h3> It is a simple API wrapper for the streaming service streamtape.com. The API documentation can be found on the docs page. The whole structure of the API has been split into different classes for easy overview and usage.</p>
14
+<h3> It is a simple API wrapper for the streaming service streamtape.com. The API documentation can be found on the [docs page](link:). The whole structure of the API has been split into different classes for easy overview and usage.</p>
15
15
16
16
</br>
17
17
18
18
19
-# Installation
19
+# Installation
20
+
21
+Install With
22
+
23
+```pyhton3
24
+pip3 install streamtapex
25
+```
26
+## Usage
27
+
28
+### General usage
20
29
▼streamtape/streamtape.py
+9-10
7
7
class Streamtape:
8
8
def __init__(self,api_key:str,api_secret:str):
9
9
self.baseurl = "https://api.streamtape.com/"
10
-
11
10
self.api_key = api_key
12
11
self.api_secret = api_secret
13
12
self.login=f"login={self.api_key}&key={self.api_secret}"
27
26
Returns a dictionary of account info
28
27
29
28
"""
30
- url=f"{self.baseurl}account/info?{self.login}"
29
+ url:str=f"{self.baseurl}account/info?{self.login}"
31
30
return self._request("GET",url)
32
31
33
32
def download_ticket(self,fileid:str)->Dict[str,Any]:
39
38
40
39
Returns a dictionary of download ticket
41
40
"""
42
- url=f"{self.baseurl}dlticket?file={fileid}&{self.login}"
41
+ url:str=f"{self.baseurl}dlticket?file={fileid}&{self.login}"
43
42
return self._request("GET",url)
44
43
45
44
def download_link(self,fileid:str,ticketid:str)->Dict[str,Any]:
53
52
Returns a dictionary of download link
54
53
55
54
"""
56
- url=f"{self.baseurl}file/dl?file={fileid}&ticket={ticketid}"
55
+ url:str=f"{self.baseurl}file/dl?file={fileid}&ticket={ticketid}"
57
56
return self._request("GET",url)
58
57
59
58
def file_info(self,file_id:str)->Dict[str,Any]:
65
64
66
65
Returns a dictionary of file info
67
66
"""
68
- url=f"{self.baseurl}file/info?file={file_id}&{self.login}"
67
+ url:str=f"{self.baseurl}file/info?file={file_id}&{self.login}"
69
68
return self._request("GET",url)
70
69
71
70
def upload_file(self,
84
83
85
84
Returns a dictionary of upload file
86
85
"""
87
- url=f"{self.baseurl}/file/ul?{self.login}&folder={folder_id}&sha256={hash}&httponly={httponly}"
86
+ url:str=f"{self.baseurl}/file/ul?{self.login}&folder={folder_id}&sha256={hash}&httponly={httponly}"
88
87
upload=self._request("GET",url)
89
88
uploadurl=upload['result']['url']
90
89
files={'file':open(file,'rb')}
121
120
122
121
Returns a dictionary of remove upload upload
123
122
"""
124
- url=f"{self.baseurl}remotedl/remove?{self.login}&id={id}"
123
+ url:str=f"{self.baseurl}remotedl/remove?{self.login}&id={id}"
125
124
126
125
return self._request("GET",url)
127
126
136
135
limit:Optional[str]-> limit of file
137
136
138
137
Returns a dictionary of cheak upload status"""
139
- url=f"{self.baseurl}remotedl/status?{self.login}&limit={file_id}&id={limit}"
138
+ url:str=f"{self.baseurl}remotedl/status?{self.login}&limit={file_id}&id={limit}"
140
139
141
140
return self._request("GET",url)
142
141
149
148
150
149
"""
151
150
if folder_id==None:
152
- url=url=f"{self.baseurl}file/listfolder?{self.login}"
151
+ url:str=f"{self.baseurl}file/listfolder?{self.login}"
153
152
else:
154
- url=f"{self.baseurl}file/listfolder?{self.login}&folder={folder_id}"
153
+ url:str=f"{self.baseurl}file/listfolder?{self.login}&folder={folder_id}"
155
154
return self._request("GET",url)
156
155
157
156
def create_folder(self,foldername:str,pid:Optional[str]=None)->Dict[str,Any]:
158
157