yt-dlp-host-api 0.0.7__py3-none-any.whl → 0.0.9__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
@@ -15,6 +15,12 @@ class Client:
15
15
  def get_audio(self, url):
16
16
  return self.send_task.get_audio(url=url).get_result()
17
17
 
18
+ def get_live_video(self, url, duration, start=0, quality="best"):
19
+ return self.send_task.get_live_video(url=url, start=start, duration=duration, quality=quality).get_result()
20
+
21
+ def get_live_audio(self, url, duration, start=0):
22
+ return self.send_task.get_live_audio(url=url, start=start, duration=duration).get_result()
23
+
18
24
  def get_info(self, url):
19
25
  return self.send_task.get_info(url=url).get_result()
20
26
 
@@ -40,14 +46,14 @@ class Client:
40
46
  return response.json()
41
47
 
42
48
  def get_key(self, name, response_json=False):
43
- response = requests.delete(f"{self.host_url}/get_key/{name}", headers=self.headers)
49
+ response = requests.get(f"{self.host_url}/get_key/{name}", headers=self.headers)
44
50
  if response.status_code != 200:
45
51
  raise APIError(response.json().get('error', 'Unknown error'))
46
52
  if response_json: return response.json()
47
53
  return response.json()['key']
48
54
 
49
- def list_keys(self):
50
- response = requests.get(f"{self.host_url}/list_keys", headers=self.headers)
55
+ def get_keys(self):
56
+ response = requests.get(f"{self.host_url}/get_keys", headers=self.headers)
51
57
  if response.status_code != 200:
52
58
  raise APIError(response.json().get('error', 'Unknown error'))
53
59
  return response.json()
@@ -69,6 +75,20 @@ class Client:
69
75
  if response.status_code != 200:
70
76
  raise APIError(response.json().get('error', 'Unknown error'))
71
77
  return Task(self.client, response.json()['task_id'], 'get_audio')
78
+
79
+ def get_live_video(self, url, duration, start=0, quality="best"):
80
+ data = {"url": url, "start": start, "duration": duration, "quality": quality}
81
+ response = requests.post(f"{self.client.host_url}/get_live_video", json=data, headers=self.client.headers)
82
+ if response.status_code != 200:
83
+ raise APIError(response.json().get('error', 'Unknown error'))
84
+ return Task(self.client, response.json()['task_id'], 'get_video')
85
+
86
+ def get_live_audio(self, url, duration, start=0):
87
+ data = {"url": url, "start": start, "duration": duration}
88
+ response = requests.post(f"{self.client.host_url}/get_live_audio", json=data, headers=self.client.headers)
89
+ if response.status_code != 200:
90
+ raise APIError(response.json().get('error', 'Unknown error'))
91
+ return Task(self.client, response.json()['task_id'], 'get_audio')
72
92
 
73
93
  def get_info(self, url):
74
94
  data = {"url": url}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: yt_dlp_host_api
3
- Version: 0.0.7
3
+ Version: 0.0.9
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
@@ -13,9 +13,9 @@ Description-Content-Type: text/markdown
13
13
  License-File: LICENSE
14
14
  Requires-Dist: requests >=2.25.1
15
15
 
16
- # yt-dlp-host API Client
16
+ # [yt-dlp-host](https://github.com/Vasysik/yt-dlp-host) API Client
17
17
 
18
- This is a Python library for interacting with the yt-dlp-host API.
18
+ This is a Python library for interacting with the [yt-dlp-host](https://github.com/Vasysik/yt-dlp-host) API.
19
19
 
20
20
  ## Installation
21
21
 
@@ -50,7 +50,7 @@ print("Video info:", info_json)
50
50
 
51
51
  # Admin operations (requires admin API key)
52
52
  new_key = client.create_key("user_key", ["get_video", "get_audio", "get_info"])
53
- keys = client.list_keys()
53
+ keys = client.get_keys()
54
54
  key = client.get_key("user_key")
55
55
  client.delete_key("user_key")
56
56
  ```
@@ -72,9 +72,13 @@ client.delete_key("user_key")
72
72
 
73
73
  - `client.get_video(url, quality='best')`: Simple way to get the result of get_video
74
74
  - `client.get_audio(url)`: Simple way to get the result of get_audio
75
+ - `client.get_live_video(url, duration, start=0, quality='best')`: Simple way to get the result of get_live_video
76
+ - `client.get_live_audio(url, duration, start=0)`: Simple way to get the result of get_live_audio
75
77
  - `client.get_info(url)`: Simple way to get the result of get_info
76
78
  - `client.send_task.get_video(url, quality='best')`: Initiates a get_video task
77
- - `client.send_task.get_audio(url, quality='best')`: Initiates a get_audio task
79
+ - `client.send_task.get_audio(url)`: Initiates a get_audio task
80
+ - `client.send_task.get_live_video(url, duration, start=0, quality='best')`: Initiates a get_video task
81
+ - `client.send_task.get_live_audio(url, duration, start=0)`: Initiates a get_audio task
78
82
  - `client.send_task.get_info(url)`: Initiates a get_info task
79
83
  - `client.check_permissions(permissions)`: Checks for all permissions in the list
80
84
 
@@ -93,7 +97,7 @@ client.delete_key("user_key")
93
97
  ### Admin
94
98
 
95
99
  - `client.create_key(name, permissions)`: Create a new API key
96
- - `client.list_keys()`: List all existing API keys
100
+ - `client.get_keys()`: List all existing API keys
97
101
  - `client.get_key(name)`: Get API key by key name
98
102
  - `client.delete_key(name)`: Delete an API key
99
103
 
@@ -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=gKZbbrrgTcjj-aXMvwmB3o9f5idMCBMokAfv80_qe54,4898
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.9.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
+ yt_dlp_host_api-0.0.9.dist-info/METADATA,sha256=u27b9ebTsU1hXYWeNgOeZqKDU7U3TX0qMwpBPL5Ucpc,3972
8
+ yt_dlp_host_api-0.0.9.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
9
+ yt_dlp_host_api-0.0.9.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
+ yt_dlp_host_api-0.0.9.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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=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,,