yt-dlp-host-api 0.0.5__py3-none-any.whl → 0.0.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
yt_dlp_host_api/client.py CHANGED
@@ -25,12 +25,13 @@ class Client:
25
25
  return False
26
26
  return True
27
27
 
28
- def create_key(self, name, permissions):
28
+ def create_key(self, name, permissions, response_json=False):
29
29
  data = {"name": name, "permissions": permissions}
30
30
  response = requests.post(f"{self.host_url}/create_key", json=data, headers=self.headers)
31
31
  if response.status_code != 201:
32
32
  raise APIError(response.json().get('error', 'Unknown error'))
33
- return response.json()
33
+ if response_json: return response.json()
34
+ return response.json()['key']
34
35
 
35
36
  def delete_key(self, name):
36
37
  response = requests.delete(f"{self.host_url}/delete_key/{name}", headers=self.headers)
@@ -38,11 +39,12 @@ class Client:
38
39
  raise APIError(response.json().get('error', 'Unknown error'))
39
40
  return response.json()
40
41
 
41
- def get_key(self, name):
42
+ def get_key(self, name, response_json=False):
42
43
  response = requests.delete(f"{self.host_url}/get_key/{name}", headers=self.headers)
43
44
  if response.status_code != 200:
44
45
  raise APIError(response.json().get('error', 'Unknown error'))
45
- return response.json()
46
+ if response_json: return response.json()
47
+ return response.json()['key']
46
48
 
47
49
  def list_keys(self):
48
50
  response = requests.get(f"{self.host_url}/list_keys", headers=self.headers)
yt_dlp_host_api/task.py CHANGED
@@ -34,11 +34,12 @@ class TaskResult:
34
34
  self.client = client
35
35
  self.status = status
36
36
 
37
- def get_file(self):
37
+ def get_file(self, raw_response=False):
38
38
  url = self.get_file_url()
39
39
  response = requests.get(url, headers=self.client.headers)
40
40
  if response.status_code != 200:
41
41
  raise APIError(response.json().get('error', 'Unknown error'))
42
+ if raw_response: return response
42
43
  return response.content
43
44
 
44
45
  def get_file_url(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yt_dlp_host_api
3
- Version: 0.0.5
3
+ Version: 0.0.7
4
4
  Summary: A Python library for interacting with the yt-dlp-host API
5
5
  Author-email: "Amadeus (Wasys)" <tubik.corp@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/Vasysik/yt-dlp-host-api
@@ -0,0 +1,10 @@
1
+ yt_dlp_host_api/__init__.py,sha256=RHx1BvH2Cy_dweEKo5sA-hdBOfBdY_2ds7srPuKGzWQ,41
2
+ yt_dlp_host_api/api.py,sha256=iLzWKoyiXeu0Y1Uky8PzpxxHTSMcTGzxlCRT121AKcM,196
3
+ yt_dlp_host_api/client.py,sha256=AwLGFEyA7QPIQAUKfkrNGRjweIxo4pBDhWG0zRnRmf4,3586
4
+ yt_dlp_host_api/exceptions.py,sha256=U_70W1R_ZcUfKptUShGB5VPWQXwc5M29_sNC8pwwq8g,38
5
+ yt_dlp_host_api/task.py,sha256=llgBAO_L1CajklMsbICdRpLdOV05Wi0oUh9NKj0bD0w,2674
6
+ yt_dlp_host_api-0.0.7.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
+ yt_dlp_host_api-0.0.7.dist-info/METADATA,sha256=r2LKdUIqRh_J4fn65wnmIxBZgkPgP8gsJ_3pmabGUQk,3498
8
+ yt_dlp_host_api-0.0.7.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
9
+ yt_dlp_host_api-0.0.7.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
+ yt_dlp_host_api-0.0.7.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- yt_dlp_host_api/__init__.py,sha256=RHx1BvH2Cy_dweEKo5sA-hdBOfBdY_2ds7srPuKGzWQ,41
2
- yt_dlp_host_api/api.py,sha256=iLzWKoyiXeu0Y1Uky8PzpxxHTSMcTGzxlCRT121AKcM,196
3
- yt_dlp_host_api/client.py,sha256=KVhgabw4MLszYhjmWopW70QoyEvqDb-E_w7CVE0P87U,3430
4
- yt_dlp_host_api/exceptions.py,sha256=U_70W1R_ZcUfKptUShGB5VPWQXwc5M29_sNC8pwwq8g,38
5
- yt_dlp_host_api/task.py,sha256=aS96ZZik0rRiLwLx1mXm9GeF9lgEOOkCW-Qp-gHmgCo,2612
6
- yt_dlp_host_api-0.0.5.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
- yt_dlp_host_api-0.0.5.dist-info/METADATA,sha256=uOkAX7RJj1ecxlPACkLfU2BiTHVA8mtsIhOUg2cr2iY,3498
8
- yt_dlp_host_api-0.0.5.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
9
- yt_dlp_host_api-0.0.5.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
- yt_dlp_host_api-0.0.5.dist-info/RECORD,,