BROKENXAPI 2.0.4__tar.gz
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.
- brokenxapi-2.0.4/BROKENXAPI.egg-info/PKG-INFO +178 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/SOURCES.txt +19 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/dependency_links.txt +1 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/entry_points.txt +2 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/not-zip-safe +1 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/requires.txt +1 -0
- brokenxapi-2.0.4/BROKENXAPI.egg-info/top_level.txt +1 -0
- brokenxapi-2.0.4/LICENSE +21 -0
- brokenxapi-2.0.4/MANIFEST.in +1 -0
- brokenxapi-2.0.4/PKG-INFO +178 -0
- brokenxapi-2.0.4/README.md +126 -0
- brokenxapi-2.0.4/brokenxapi/__init__.py +16 -0
- brokenxapi-2.0.4/brokenxapi/__version__.py +2 -0
- brokenxapi-2.0.4/brokenxapi/auth.py +11 -0
- brokenxapi-2.0.4/brokenxapi/cli.py +51 -0
- brokenxapi-2.0.4/brokenxapi/client.pyc +0 -0
- brokenxapi-2.0.4/brokenxapi/exceptions.py +11 -0
- brokenxapi-2.0.4/brokenxapi/models.py +19 -0
- brokenxapi-2.0.4/pyproject.toml +70 -0
- brokenxapi-2.0.4/setup.cfg +4 -0
- brokenxapi-2.0.4/setup.py +15 -0
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BROKENXAPI
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: Official async Python SDK and CLI for BrokenX YouTube API
|
|
5
|
+
Author-email: Mr Broken <brokenxnetwork@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Mr Broken
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/mrxbroken011/BROKENXAPI
|
|
29
|
+
Project-URL: Repository, https://github.com/mrxbroken011/BROKENXAPI
|
|
30
|
+
Project-URL: Documentation, https://brokenxapi-docs.vercel.app
|
|
31
|
+
Project-URL: Issues, https://github.com/mrxbroken011/BROKENXAPI/issues
|
|
32
|
+
Keywords: brokenx,youtube,api,async,sdk,cli,aiohttp,telegram
|
|
33
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
36
|
+
Classifier: Topic :: Multimedia :: Video
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
46
|
+
Classifier: Framework :: AsyncIO
|
|
47
|
+
Requires-Python: >=3.8
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
License-File: LICENSE
|
|
50
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
# BROKENXAPI
|
|
54
|
+
|
|
55
|
+
**BROKENXAPI** is a high-performance asynchronous **Python SDK and CLI** that enables developers to search and download YouTube audio or video through a remote backend API.
|
|
56
|
+
|
|
57
|
+
It is built for **automation tools**, **Telegram bots**, and **production systems** where reliability, speed, and a clean developer experience are critical.
|
|
58
|
+
|
|
59
|
+
The SDK abstracts authentication and networking, while the CLI provides a fast and simple way to interact with the API directly from the terminal.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
<p align="center">
|
|
64
|
+
<img src="./docs/brokenx.gif" width="600" />
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
|
|
71
|
+
Install via pip:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install BROKENXAPI
|
|
75
|
+
````
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Authentication
|
|
80
|
+
|
|
81
|
+
BROKENXAPI requires an API key for all requests.
|
|
82
|
+
|
|
83
|
+
### Environment Variable (Recommended)
|
|
84
|
+
|
|
85
|
+
**Linux / macOS**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
export YTKEY="BROKENXAPI-XXXX"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Windows**
|
|
92
|
+
|
|
93
|
+
```bat
|
|
94
|
+
set YTKEY=BROKENXAPI-XXXX
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Python SDK Usage
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import asyncio
|
|
103
|
+
from brokenxapi import BrokenXAPI
|
|
104
|
+
|
|
105
|
+
async def main():
|
|
106
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
107
|
+
# Search YouTube
|
|
108
|
+
search = await api.search("moosetape", video=False)
|
|
109
|
+
video_id = search["video_id"]
|
|
110
|
+
|
|
111
|
+
# Download audio
|
|
112
|
+
audio = await api.download(video_id, "audio")
|
|
113
|
+
print(audio["telegram_url"])
|
|
114
|
+
|
|
115
|
+
asyncio.run(main())
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Download Video (SDK)
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
124
|
+
video = await api.download("VIDEO_ID", "video")
|
|
125
|
+
print(video["telegram_url"])
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## CLI Usage
|
|
131
|
+
|
|
132
|
+
Authenticate once:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
brokenx auth BROKENXAPI-XXXX
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Check installed version:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
brokenx -v
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Search YouTube:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
brokenx search "moosetape"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Download audio:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
brokenx download VIDEO_ID
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Download video:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
brokenx download VIDEO_ID -v
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Notes
|
|
165
|
+
|
|
166
|
+
* Python **3.8+** is required
|
|
167
|
+
* An API key is mandatory for all requests
|
|
168
|
+
* All responses are returned as JSON-compatible dictionaries
|
|
169
|
+
* Download responses include a **Telegram-ready file URL**
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
© 2025 **MR Broken**
|
|
176
|
+
All rights reserved.
|
|
177
|
+
|
|
178
|
+
---
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
MANIFEST.in
|
|
3
|
+
README.md
|
|
4
|
+
pyproject.toml
|
|
5
|
+
setup.py
|
|
6
|
+
BROKENXAPI.egg-info/PKG-INFO
|
|
7
|
+
BROKENXAPI.egg-info/SOURCES.txt
|
|
8
|
+
BROKENXAPI.egg-info/dependency_links.txt
|
|
9
|
+
BROKENXAPI.egg-info/entry_points.txt
|
|
10
|
+
BROKENXAPI.egg-info/not-zip-safe
|
|
11
|
+
BROKENXAPI.egg-info/requires.txt
|
|
12
|
+
BROKENXAPI.egg-info/top_level.txt
|
|
13
|
+
brokenxapi/__init__.py
|
|
14
|
+
brokenxapi/__version__.py
|
|
15
|
+
brokenxapi/auth.py
|
|
16
|
+
brokenxapi/cli.py
|
|
17
|
+
brokenxapi/client.pyc
|
|
18
|
+
brokenxapi/exceptions.py
|
|
19
|
+
brokenxapi/models.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
aiohttp>=3.8.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
brokenxapi
|
brokenxapi-2.0.4/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mr Broken
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
recursive-include brokenxapi *.pyc
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: BROKENXAPI
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: Official async Python SDK and CLI for BrokenX YouTube API
|
|
5
|
+
Author-email: Mr Broken <brokenxnetwork@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Mr Broken
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/mrxbroken011/BROKENXAPI
|
|
29
|
+
Project-URL: Repository, https://github.com/mrxbroken011/BROKENXAPI
|
|
30
|
+
Project-URL: Documentation, https://brokenxapi-docs.vercel.app
|
|
31
|
+
Project-URL: Issues, https://github.com/mrxbroken011/BROKENXAPI/issues
|
|
32
|
+
Keywords: brokenx,youtube,api,async,sdk,cli,aiohttp,telegram
|
|
33
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
36
|
+
Classifier: Topic :: Multimedia :: Video
|
|
37
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
38
|
+
Classifier: Operating System :: OS Independent
|
|
39
|
+
Classifier: Programming Language :: Python :: 3
|
|
40
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
45
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
46
|
+
Classifier: Framework :: AsyncIO
|
|
47
|
+
Requires-Python: >=3.8
|
|
48
|
+
Description-Content-Type: text/markdown
|
|
49
|
+
License-File: LICENSE
|
|
50
|
+
Requires-Dist: aiohttp>=3.8.0
|
|
51
|
+
Dynamic: license-file
|
|
52
|
+
|
|
53
|
+
# BROKENXAPI
|
|
54
|
+
|
|
55
|
+
**BROKENXAPI** is a high-performance asynchronous **Python SDK and CLI** that enables developers to search and download YouTube audio or video through a remote backend API.
|
|
56
|
+
|
|
57
|
+
It is built for **automation tools**, **Telegram bots**, and **production systems** where reliability, speed, and a clean developer experience are critical.
|
|
58
|
+
|
|
59
|
+
The SDK abstracts authentication and networking, while the CLI provides a fast and simple way to interact with the API directly from the terminal.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
<p align="center">
|
|
64
|
+
<img src="./docs/brokenx.gif" width="600" />
|
|
65
|
+
</p>
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
|
|
71
|
+
Install via pip:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
pip install BROKENXAPI
|
|
75
|
+
````
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Authentication
|
|
80
|
+
|
|
81
|
+
BROKENXAPI requires an API key for all requests.
|
|
82
|
+
|
|
83
|
+
### Environment Variable (Recommended)
|
|
84
|
+
|
|
85
|
+
**Linux / macOS**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
export YTKEY="BROKENXAPI-XXXX"
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Windows**
|
|
92
|
+
|
|
93
|
+
```bat
|
|
94
|
+
set YTKEY=BROKENXAPI-XXXX
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## Python SDK Usage
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import asyncio
|
|
103
|
+
from brokenxapi import BrokenXAPI
|
|
104
|
+
|
|
105
|
+
async def main():
|
|
106
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
107
|
+
# Search YouTube
|
|
108
|
+
search = await api.search("moosetape", video=False)
|
|
109
|
+
video_id = search["video_id"]
|
|
110
|
+
|
|
111
|
+
# Download audio
|
|
112
|
+
audio = await api.download(video_id, "audio")
|
|
113
|
+
print(audio["telegram_url"])
|
|
114
|
+
|
|
115
|
+
asyncio.run(main())
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Download Video (SDK)
|
|
121
|
+
|
|
122
|
+
```python
|
|
123
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
124
|
+
video = await api.download("VIDEO_ID", "video")
|
|
125
|
+
print(video["telegram_url"])
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## CLI Usage
|
|
131
|
+
|
|
132
|
+
Authenticate once:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
brokenx auth BROKENXAPI-XXXX
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Check installed version:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
brokenx -v
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Search YouTube:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
brokenx search "moosetape"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Download audio:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
brokenx download VIDEO_ID
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Download video:
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
brokenx download VIDEO_ID -v
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Notes
|
|
165
|
+
|
|
166
|
+
* Python **3.8+** is required
|
|
167
|
+
* An API key is mandatory for all requests
|
|
168
|
+
* All responses are returned as JSON-compatible dictionaries
|
|
169
|
+
* Download responses include a **Telegram-ready file URL**
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## License
|
|
174
|
+
|
|
175
|
+
© 2025 **MR Broken**
|
|
176
|
+
All rights reserved.
|
|
177
|
+
|
|
178
|
+
---
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# BROKENXAPI
|
|
2
|
+
|
|
3
|
+
**BROKENXAPI** is a high-performance asynchronous **Python SDK and CLI** that enables developers to search and download YouTube audio or video through a remote backend API.
|
|
4
|
+
|
|
5
|
+
It is built for **automation tools**, **Telegram bots**, and **production systems** where reliability, speed, and a clean developer experience are critical.
|
|
6
|
+
|
|
7
|
+
The SDK abstracts authentication and networking, while the CLI provides a fast and simple way to interact with the API directly from the terminal.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="./docs/brokenx.gif" width="600" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
Install via pip:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install BROKENXAPI
|
|
23
|
+
````
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Authentication
|
|
28
|
+
|
|
29
|
+
BROKENXAPI requires an API key for all requests.
|
|
30
|
+
|
|
31
|
+
### Environment Variable (Recommended)
|
|
32
|
+
|
|
33
|
+
**Linux / macOS**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export YTKEY="BROKENXAPI-XXXX"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
**Windows**
|
|
40
|
+
|
|
41
|
+
```bat
|
|
42
|
+
set YTKEY=BROKENXAPI-XXXX
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Python SDK Usage
|
|
48
|
+
|
|
49
|
+
```python
|
|
50
|
+
import asyncio
|
|
51
|
+
from brokenxapi import BrokenXAPI
|
|
52
|
+
|
|
53
|
+
async def main():
|
|
54
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
55
|
+
# Search YouTube
|
|
56
|
+
search = await api.search("moosetape", video=False)
|
|
57
|
+
video_id = search["video_id"]
|
|
58
|
+
|
|
59
|
+
# Download audio
|
|
60
|
+
audio = await api.download(video_id, "audio")
|
|
61
|
+
print(audio["telegram_url"])
|
|
62
|
+
|
|
63
|
+
asyncio.run(main())
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## Download Video (SDK)
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
async with BrokenXAPI(api_key="BROKENXAPI-XXXX") as api:
|
|
72
|
+
video = await api.download("VIDEO_ID", "video")
|
|
73
|
+
print(video["telegram_url"])
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## CLI Usage
|
|
79
|
+
|
|
80
|
+
Authenticate once:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
brokenx auth BROKENXAPI-XXXX
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Check installed version:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
brokenx -v
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Search YouTube:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
brokenx search "moosetape"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Download audio:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
brokenx download VIDEO_ID
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Download video:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
brokenx download VIDEO_ID -v
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Notes
|
|
113
|
+
|
|
114
|
+
* Python **3.8+** is required
|
|
115
|
+
* An API key is mandatory for all requests
|
|
116
|
+
* All responses are returned as JSON-compatible dictionaries
|
|
117
|
+
* Download responses include a **Telegram-ready file URL**
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## License
|
|
122
|
+
|
|
123
|
+
© 2025 **MR Broken**
|
|
124
|
+
All rights reserved.
|
|
125
|
+
|
|
126
|
+
---
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from .client import BrokenXAPI
|
|
2
|
+
import logging
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
__all__ = ["BrokenXAPI"]
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
logger = logging.getLogger("BrokenXAPI")
|
|
10
|
+
|
|
11
|
+
logger.info("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
|
12
|
+
logger.info("🚀 BROKENXAPI INITIALIZED")
|
|
13
|
+
logger.info("⚡ Powered by Broken X Network")
|
|
14
|
+
logger.info("🔐 Secure • Async • Fast")
|
|
15
|
+
logger.info("Thanks ❤🩹 For Using BrokenxAPI")
|
|
16
|
+
logger.info("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━")
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import argparse
|
|
2
|
+
import asyncio
|
|
3
|
+
from .client import BrokenXAPI
|
|
4
|
+
from .auth import get_key, save_key
|
|
5
|
+
from .__version__ import __version__
|
|
6
|
+
|
|
7
|
+
def main():
|
|
8
|
+
parser = argparse.ArgumentParser("brokenx")
|
|
9
|
+
parser.add_argument("-v", "--version", action="store_true")
|
|
10
|
+
|
|
11
|
+
sub = parser.add_subparsers(dest="cmd")
|
|
12
|
+
|
|
13
|
+
auth = sub.add_parser("auth")
|
|
14
|
+
auth.add_argument("key")
|
|
15
|
+
|
|
16
|
+
search = sub.add_parser("search")
|
|
17
|
+
search.add_argument("query")
|
|
18
|
+
|
|
19
|
+
dl = sub.add_parser("download")
|
|
20
|
+
dl.add_argument("video_id")
|
|
21
|
+
dl.add_argument("-v", "--video", action="store_true")
|
|
22
|
+
|
|
23
|
+
args = parser.parse_args()
|
|
24
|
+
|
|
25
|
+
if args.version:
|
|
26
|
+
print(__version__)
|
|
27
|
+
return
|
|
28
|
+
|
|
29
|
+
if args.cmd == "auth":
|
|
30
|
+
save_key(args.key)
|
|
31
|
+
print("✅ API key saved")
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
api_key = get_key()
|
|
35
|
+
if not api_key:
|
|
36
|
+
print("❌ Please run: brokenx auth <API_KEY>")
|
|
37
|
+
return
|
|
38
|
+
|
|
39
|
+
asyncio.run(run(args, api_key))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
async def run(args, api_key):
|
|
43
|
+
async with BrokenXAPI(api_key) as api:
|
|
44
|
+
if args.cmd == "search":
|
|
45
|
+
res = await api.search(args.query)
|
|
46
|
+
print(res)
|
|
47
|
+
|
|
48
|
+
elif args.cmd == "download":
|
|
49
|
+
media = "video" if args.video else "audio"
|
|
50
|
+
res = await api.download(args.video_id, media)
|
|
51
|
+
print(res["telegram_url"])
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import TypedDict
|
|
2
|
+
|
|
3
|
+
class DownloadResponse(TypedDict, total=False):
|
|
4
|
+
success: bool
|
|
5
|
+
status: str
|
|
6
|
+
video_id: str
|
|
7
|
+
type: str
|
|
8
|
+
telegram_url: str
|
|
9
|
+
thumbnail: str
|
|
10
|
+
source: str
|
|
11
|
+
|
|
12
|
+
class SearchResponse(TypedDict, total=False):
|
|
13
|
+
success: bool
|
|
14
|
+
status: str
|
|
15
|
+
title: str
|
|
16
|
+
video_id: str
|
|
17
|
+
duration: str
|
|
18
|
+
thumbnail: str
|
|
19
|
+
stream_url: str
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "BROKENXAPI"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "Official async Python SDK and CLI for BrokenX YouTube API"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
license = { file = "LICENSE" }
|
|
7
|
+
|
|
8
|
+
authors = [
|
|
9
|
+
{ name = "Mr Broken", email = "brokenxnetwork@gmail.com" }
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
keywords = [
|
|
13
|
+
"brokenx",
|
|
14
|
+
"youtube",
|
|
15
|
+
"api",
|
|
16
|
+
"async",
|
|
17
|
+
"sdk",
|
|
18
|
+
"cli",
|
|
19
|
+
"aiohttp",
|
|
20
|
+
"telegram"
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 5 - Production/Stable",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
|
|
27
|
+
"Topic :: Software Development :: Libraries",
|
|
28
|
+
"Topic :: Multimedia :: Video",
|
|
29
|
+
|
|
30
|
+
"License :: OSI Approved :: MIT License",
|
|
31
|
+
"Operating System :: OS Independent",
|
|
32
|
+
|
|
33
|
+
"Programming Language :: Python :: 3",
|
|
34
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
35
|
+
"Programming Language :: Python :: 3.8",
|
|
36
|
+
"Programming Language :: Python :: 3.9",
|
|
37
|
+
"Programming Language :: Python :: 3.10",
|
|
38
|
+
"Programming Language :: Python :: 3.11",
|
|
39
|
+
"Programming Language :: Python :: 3.12",
|
|
40
|
+
|
|
41
|
+
"Framework :: AsyncIO"
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
requires-python = ">=3.8"
|
|
45
|
+
|
|
46
|
+
dependencies = [
|
|
47
|
+
"aiohttp>=3.8.0"
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
[project.urls]
|
|
51
|
+
Homepage = "https://github.com/mrxbroken011/BROKENXAPI"
|
|
52
|
+
Repository = "https://github.com/mrxbroken011/BROKENXAPI"
|
|
53
|
+
Documentation = "https://brokenxapi-docs.vercel.app"
|
|
54
|
+
Issues = "https://github.com/mrxbroken011/BROKENXAPI/issues"
|
|
55
|
+
|
|
56
|
+
# ---------------- CLI ENTRY ----------------
|
|
57
|
+
[project.scripts]
|
|
58
|
+
brokenx = "brokenxapi.cli:main"
|
|
59
|
+
|
|
60
|
+
# ---------------- SETUPTOOLS ----------------
|
|
61
|
+
[tool.setuptools]
|
|
62
|
+
include-package-data = true
|
|
63
|
+
|
|
64
|
+
[tool.setuptools.packages.find]
|
|
65
|
+
include = ["brokenxapi*"]
|
|
66
|
+
|
|
67
|
+
# ---------------- BUILD SYSTEM ----------------
|
|
68
|
+
[build-system]
|
|
69
|
+
requires = ["setuptools>=69.0", "wheel>=0.43.0"]
|
|
70
|
+
build-backend = "setuptools.build_meta"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
about = {}
|
|
5
|
+
|
|
6
|
+
here = os.path.abspath(os.path.dirname(__file__))
|
|
7
|
+
version_file = os.path.join(here, "brokenxapi", "__version__.py")
|
|
8
|
+
|
|
9
|
+
with open(version_file, encoding="utf-8") as f:
|
|
10
|
+
exec(f.read(), about)
|
|
11
|
+
|
|
12
|
+
setup(
|
|
13
|
+
version=about["__version__"],
|
|
14
|
+
zip_safe=False,
|
|
15
|
+
)
|