yt-dlp-host-api 0.1.0__py3-none-any.whl → 0.1.1__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,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, 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()
12
+ def get_video(self, url, video_format="bestvideo", audio_format="bestaudio"):
13
+ return self.send_task.get_video(url=url, video_format=video_format, audio_format=audio_format).get_result()
14
14
 
15
- def get_audio(self, url, audio_quality="best"):
16
- return self.send_task.get_audio(url=url, audio_quality=audio_quality).get_result()
15
+ def get_audio(self, url, audio_format="bestaudio"):
16
+ return self.send_task.get_audio(url=url, audio_format=audio_format).get_result()
17
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()
18
+ def get_live_video(self, url, duration, start=0, video_format="bestvideo", audio_format="bestaudio"):
19
+ return self.send_task.get_live_video(url=url, start=start, duration=duration, video_format=video_format, audio_format=audio_format).get_result()
20
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()
21
+ def get_live_audio(self, url, duration, start=0, audio_format="bestaudio"):
22
+ return self.send_task.get_live_audio(url=url, start=start, duration=duration, audio_format=audio_format).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, video_quality="best", audio_quality="best"):
66
- data = {"url": url, "video_quality": video_quality, "audio_quality": audio_quality}
65
+ def get_video(self, url, video_format="bestvideo", audio_format="bestaudio"):
66
+ data = {"url": url, "video_format": video_format, "audio_format": audio_format}
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, audio_quality="best"):
73
- data = {"url": url, "audio_quality": audio_quality}
72
+ def get_audio(self, url, audio_format="bestaudio"):
73
+ data = {"url": url, "audio_format": audio_format}
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, video_quality="best", audio_quality="best"):
80
- data = {"url": url, "start": start, "duration": duration, "video_quality": video_quality, "audio_quality": audio_quality}
79
+ def get_live_video(self, url, duration, start=0, video_format="bestvideo", audio_format="bestaudio"):
80
+ data = {"url": url, "start": start, "duration": duration, "video_format": video_format, "audio_format": audio_format}
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, audio_quality="best"):
87
- data = {"url": url, "start": start, "duration": duration, "audio_quality": audio_quality}
86
+ def get_live_audio(self, url, duration, start=0, audio_format="bestaudio"):
87
+ data = {"url": url, "start": start, "duration": duration, "audio_format": audio_format}
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.1.0
3
+ Version: 0.1.1
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
@@ -70,15 +70,15 @@ client.delete_key("user_key")
70
70
 
71
71
  ### Client
72
72
 
73
- - `client.get_video(url, quality='best')`: Simple way to get the result of get_video
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
73
+ - `client.get_video(url, video_format="bestvideo", audio_format="bestaudio")`: Simple way to get the result of get_video
74
+ - `client.get_audio(url, audio_format="bestaudio")`: Simple way to get the result of get_audio
75
+ - `client.get_live_video(url, duration, start=0, video_format="bestvideo", audio_format="bestaudio")`: Simple way to get the result of get_live_video
76
+ - `client.get_live_audio(url, duration, start=0, audio_format="bestaudio")`: Simple way to get the result of get_live_audio
77
77
  - `client.get_info(url)`: Simple way to get the result of get_info
78
- - `client.send_task.get_video(url, quality='best')`: Initiates a get_video 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
+ - `client.send_task.get_video(url, video_format="bestvideo", audio_format="bestaudio")`: Initiates a get_video task
79
+ - `client.send_task.get_audio(url, audio_format="bestaudio")`: Initiates a get_audio task
80
+ - `client.send_task.get_live_video(url, duration, start=0, video_format="bestvideo", audio_format="bestaudio")`: Initiates a get_video task
81
+ - `client.send_task.get_live_audio(url, duration, start=0, audio_format="bestaudio")`: Initiates a get_audio task
82
82
  - `client.send_task.get_info(url)`: Initiates a get_info task
83
83
  - `client.check_permissions(permissions)`: Checks for all permissions in the list
84
84
 
@@ -1,10 +1,10 @@
1
1
  yt_dlp_host_api/__init__.py,sha256=RHx1BvH2Cy_dweEKo5sA-hdBOfBdY_2ds7srPuKGzWQ,41
2
2
  yt_dlp_host_api/api.py,sha256=iLzWKoyiXeu0Y1Uky8PzpxxHTSMcTGzxlCRT121AKcM,196
3
- yt_dlp_host_api/client.py,sha256=l8-pdx4NiKggWsGpMtR_-59Ix4Fprhtt9dq-VU4twN8,5390
3
+ yt_dlp_host_api/client.py,sha256=qFmyKQIOwmd_5C5V27iTrvYRsKWImksfeHSBJokMFdA,5414
4
4
  yt_dlp_host_api/exceptions.py,sha256=U_70W1R_ZcUfKptUShGB5VPWQXwc5M29_sNC8pwwq8g,38
5
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,,
6
+ yt_dlp_host_api-0.1.1.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
7
+ yt_dlp_host_api-0.1.1.dist-info/METADATA,sha256=zkMxELh07KcHK3vpHeE19Ohy7gqdehSaDFwA2GX_rTc,4220
8
+ yt_dlp_host_api-0.1.1.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
9
+ yt_dlp_host_api-0.1.1.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
10
+ yt_dlp_host_api-0.1.1.dist-info/RECORD,,