yt-dlp-host-api 0.0.1__py3-none-any.whl → 0.0.3__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 +8 -1
- {yt_dlp_host_api-0.0.1.dist-info → yt_dlp_host_api-0.0.3.dist-info}/METADATA +4 -2
- {yt_dlp_host_api-0.0.1.dist-info → yt_dlp_host_api-0.0.3.dist-info}/RECORD +6 -6
- {yt_dlp_host_api-0.0.1.dist-info → yt_dlp_host_api-0.0.3.dist-info}/LICENSE +0 -0
- {yt_dlp_host_api-0.0.1.dist-info → yt_dlp_host_api-0.0.3.dist-info}/WHEEL +0 -0
- {yt_dlp_host_api-0.0.1.dist-info → yt_dlp_host_api-0.0.3.dist-info}/top_level.txt +0 -0
yt_dlp_host_api/client.py
CHANGED
@@ -18,7 +18,14 @@ class Client:
|
|
18
18
|
|
19
19
|
def get_info(self, url):
|
20
20
|
return self.send_task.get_info(url=url).get_result()
|
21
|
-
|
21
|
+
|
22
|
+
def check_permissions(self, permissions):
|
23
|
+
data = {"permissions": permissions}
|
24
|
+
response = requests.post(f"{self.host_url}/check_permissions", json=data, headers=self.headers)
|
25
|
+
if response.status_code != 200:
|
26
|
+
return False
|
27
|
+
return True
|
28
|
+
|
22
29
|
class SendTask:
|
23
30
|
def __init__(self, client):
|
24
31
|
self.client = client
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: yt_dlp_host_api
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.3
|
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
|
@@ -49,7 +49,7 @@ info_json = client.get_info(url='https://youtu.be/1FPdtR_5KFo').get_json(['quali
|
|
49
49
|
print("Video info:", info_json)
|
50
50
|
|
51
51
|
# Admin operations (requires admin API key)
|
52
|
-
new_key = client.admin.create_key("user_key", ["get_video", "get_info"])
|
52
|
+
new_key = client.admin.create_key("user_key", ["get_video", "get_audio", "get_info"])
|
53
53
|
keys = client.admin.list_keys()
|
54
54
|
client.admin.delete_key("user_key")
|
55
55
|
```
|
@@ -58,6 +58,7 @@ client.admin.delete_key("user_key")
|
|
58
58
|
|
59
59
|
- Download YouTube videos
|
60
60
|
- Retrieve video information
|
61
|
+
- Checking client permissions
|
61
62
|
- Admin operations:
|
62
63
|
- Create new API keys
|
63
64
|
- List existing API keys
|
@@ -73,6 +74,7 @@ client.admin.delete_key("user_key")
|
|
73
74
|
- `client.send_task.get_video(url, quality='best')`: Initiates a get_video task
|
74
75
|
- `client.send_task.get_audio(url, quality='best')`: Initiates a get_audio task
|
75
76
|
- `client.send_task.get_info(url)`: Initiates a get_info task
|
77
|
+
- `client.check_permissions(permissions)`: Checks for all permissions in the list
|
76
78
|
|
77
79
|
### Task
|
78
80
|
|
@@ -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=
|
3
|
+
yt_dlp_host_api/client.py,sha256=M3u00px7scNqskwCBL835xKGPpFqI2HsG00OQFJIsHY,3393
|
4
4
|
yt_dlp_host_api/exceptions.py,sha256=U_70W1R_ZcUfKptUShGB5VPWQXwc5M29_sNC8pwwq8g,38
|
5
5
|
yt_dlp_host_api/task.py,sha256=aS96ZZik0rRiLwLx1mXm9GeF9lgEOOkCW-Qp-gHmgCo,2612
|
6
|
-
yt_dlp_host_api-0.0.
|
7
|
-
yt_dlp_host_api-0.0.
|
8
|
-
yt_dlp_host_api-0.0.
|
9
|
-
yt_dlp_host_api-0.0.
|
10
|
-
yt_dlp_host_api-0.0.
|
6
|
+
yt_dlp_host_api-0.0.3.dist-info/LICENSE,sha256=-_Ad_xue4UymJ8jO-ZsSg0vmZ6SUm8WYdoEwHLyBUlc,1078
|
7
|
+
yt_dlp_host_api-0.0.3.dist-info/METADATA,sha256=QAShi22rNR3O-PEnNa2sJXaFSIMZZquQjEzHofxUq2U,3420
|
8
|
+
yt_dlp_host_api-0.0.3.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
9
|
+
yt_dlp_host_api-0.0.3.dist-info/top_level.txt,sha256=Mn3FZuqLCHr47sRjhtEOz7lDl4lpsHkymWANORYp72s,16
|
10
|
+
yt_dlp_host_api-0.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|