yt-dlp-host-api 0.0.8__py3-none-any.whl → 0.1.0__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
@@ -9,11 +9,17 @@ class Client:
9
9
  self.headers = {"X-API-Key": api_key, "Content-Type": "application/json"}
10
10
  self.send_task = self.SendTask(self)
11
11
 
12
- def get_video(self, url, quality="best"):
13
- return self.send_task.get_video(url=url, quality=quality).get_result()
12
+ def get_video(self, url, video_quality="best", audio_quality="best"):
13
+ return self.send_task.get_video(url=url, video_quality=video_quality, audio_quality=audio_quality).get_result()
14
14
 
15
- def get_audio(self, url):
16
- return self.send_task.get_audio(url=url).get_result()
15
+ def get_audio(self, url, audio_quality="best"):
16
+ return self.send_task.get_audio(url=url, audio_quality=audio_quality).get_result()
17
+
18
+ def get_live_video(self, url, duration, start=0, video_quality="best", audio_quality="best"):
19
+ return self.send_task.get_live_video(url=url, start=start, duration=duration, video_quality=video_quality, audio_quality=audio_quality).get_result()
20
+
21
+ def get_live_audio(self, url, duration, start=0, audio_quality="best"):
22
+ return self.send_task.get_live_audio(url=url, start=start, duration=duration, audio_quality=audio_quality).get_result()
17
23
 
18
24
  def get_info(self, url):
19
25
  return self.send_task.get_info(url=url).get_result()
@@ -56,19 +62,33 @@ class Client:
56
62
  def __init__(self, client):
57
63
  self.client = client
58
64
 
59
- def get_video(self, url, quality="best"):
60
- data = {"url": url, "quality": quality}
65
+ def get_video(self, url, video_quality="best", audio_quality="best"):
66
+ data = {"url": url, "video_quality": video_quality, "audio_quality": audio_quality}
61
67
  response = requests.post(f"{self.client.host_url}/get_video", json=data, headers=self.client.headers)
62
68
  if response.status_code != 200:
63
69
  raise APIError(response.json().get('error', 'Unknown error'))
64
70
  return Task(self.client, response.json()['task_id'], 'get_video')
65
71
 
66
- def get_audio(self, url):
67
- data = {"url": url}
72
+ def get_audio(self, url, audio_quality="best"):
73
+ data = {"url": url, "audio_quality": audio_quality}
68
74
  response = requests.post(f"{self.client.host_url}/get_audio", json=data, headers=self.client.headers)
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, video_quality="best", audio_quality="best"):
80
+ data = {"url": url, "start": start, "duration": duration, "video_quality": video_quality, "audio_quality": audio_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, audio_quality="best"):
87
+ data = {"url": url, "start": start, "duration": duration, "audio_quality": audio_quality}
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.8
3
+ Version: 0.1.0
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
 
@@ -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
 
@@ -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=l8-pdx4NiKggWsGpMtR_-59Ix4Fprhtt9dq-VU4twN8,5390
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.1.0.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
+ yt_dlp_host_api-0.1.0.dist-info/METADATA,sha256=26qGluTLCP0ci6bAG9SlwrX3XA1fKxtIqwZcu0L7faQ,3972
8
+ yt_dlp_host_api-0.1.0.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
9
+ yt_dlp_host_api-0.1.0.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
+ yt_dlp_host_api-0.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.1.0)
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=TDyzpKwhTqwi_Ob3oV3KCweZG-GDolPo6FFcdR_h0UE,3581
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.8.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
- yt_dlp_host_api-0.0.8.dist-info/METADATA,sha256=I3nTkfbB2BVY9nStph5DrHVDQoLQ9JQdLItbYLCqnFA,3496
8
- yt_dlp_host_api-0.0.8.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
9
- yt_dlp_host_api-0.0.8.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
- yt_dlp_host_api-0.0.8.dist-info/RECORD,,