yt-dlp-host-api 0.0.9__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 +16 -16
- {yt_dlp_host_api-0.0.9.dist-info → yt_dlp_host_api-0.1.0.dist-info}/METADATA +1 -1
- yt_dlp_host_api-0.1.0.dist-info/RECORD +10 -0
- {yt_dlp_host_api-0.0.9.dist-info → yt_dlp_host_api-0.1.0.dist-info}/WHEEL +1 -1
- yt_dlp_host_api-0.0.9.dist-info/RECORD +0 -10
- {yt_dlp_host_api-0.0.9.dist-info → yt_dlp_host_api-0.1.0.dist-info}/LICENSE +0 -0
- {yt_dlp_host_api-0.0.9.dist-info → yt_dlp_host_api-0.1.0.dist-info}/top_level.txt +0 -0
yt_dlp_host_api/client.py
CHANGED
@@ -9,17 +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,
|
13
|
-
return self.send_task.get_video(url=url,
|
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
17
|
|
18
|
-
def get_live_video(self, url, duration, start=0,
|
19
|
-
return self.send_task.get_live_video(url=url, start=start, duration=duration,
|
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
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()
|
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()
|
23
23
|
|
24
24
|
def get_info(self, url):
|
25
25
|
return self.send_task.get_info(url=url).get_result()
|
@@ -62,29 +62,29 @@ class Client:
|
|
62
62
|
def __init__(self, client):
|
63
63
|
self.client = client
|
64
64
|
|
65
|
-
def get_video(self, url,
|
66
|
-
data = {"url": url, "
|
65
|
+
def get_video(self, url, video_quality="best", audio_quality="best"):
|
66
|
+
data = {"url": url, "video_quality": video_quality, "audio_quality": audio_quality}
|
67
67
|
response = requests.post(f"{self.client.host_url}/get_video", json=data, headers=self.client.headers)
|
68
68
|
if response.status_code != 200:
|
69
69
|
raise APIError(response.json().get('error', 'Unknown error'))
|
70
70
|
return Task(self.client, response.json()['task_id'], 'get_video')
|
71
71
|
|
72
|
-
def get_audio(self, url):
|
73
|
-
data = {"url": url}
|
72
|
+
def get_audio(self, url, audio_quality="best"):
|
73
|
+
data = {"url": url, "audio_quality": audio_quality}
|
74
74
|
response = requests.post(f"{self.client.host_url}/get_audio", json=data, headers=self.client.headers)
|
75
75
|
if response.status_code != 200:
|
76
76
|
raise APIError(response.json().get('error', 'Unknown error'))
|
77
77
|
return Task(self.client, response.json()['task_id'], 'get_audio')
|
78
78
|
|
79
|
-
def get_live_video(self, url, duration, start=0,
|
80
|
-
data = {"url": url, "start": start, "duration": duration, "
|
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
81
|
response = requests.post(f"{self.client.host_url}/get_live_video", json=data, headers=self.client.headers)
|
82
82
|
if response.status_code != 200:
|
83
83
|
raise APIError(response.json().get('error', 'Unknown error'))
|
84
84
|
return Task(self.client, response.json()['task_id'], 'get_video')
|
85
85
|
|
86
|
-
def get_live_audio(self, url, duration, start=0):
|
87
|
-
data = {"url": url, "start": start, "duration": duration}
|
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
88
|
response = requests.post(f"{self.client.host_url}/get_live_audio", json=data, headers=self.client.headers)
|
89
89
|
if response.status_code != 200:
|
90
90
|
raise APIError(response.json().get('error', 'Unknown error'))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: yt_dlp_host_api
|
3
|
-
Version: 0.0
|
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
|
@@ -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,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=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,,
|
File without changes
|
File without changes
|