media-downloader 2.1.13__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.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012-2023 Audel Rouhi
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ include README.md include requirements.txt recursive-include media_downloader *.py
@@ -0,0 +1,346 @@
1
+ Metadata-Version: 2.4
2
+ Name: media-downloader
3
+ Version: 2.1.13
4
+ Summary: Download audio/videos from the internet!
5
+ Author-email: Audel Rouhi <knucklessg1@gmail.com>
6
+ License: MIT
7
+ Classifier: Development Status :: 5 - Production/Stable
8
+ Classifier: License :: Public Domain
9
+ Classifier: Environment :: Console
10
+ Classifier: Operating System :: POSIX :: Linux
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: yt-dlp>=2025.9.26
16
+ Provides-Extra: mcp
17
+ Requires-Dist: fastmcp>=2.13.0.2; extra == "mcp"
18
+ Provides-Extra: a2a
19
+ Requires-Dist: pydantic-ai-slim[a2a,anthropic,fastmcp,google,huggingface,openai]>=1.32.0; extra == "a2a"
20
+ Provides-Extra: all
21
+ Requires-Dist: fastmcp>=2.13.0.2; extra == "all"
22
+ Requires-Dist: pydantic-ai-slim[a2a,anthropic,fastmcp,google,huggingface,openai]>=1.32.0; extra == "all"
23
+ Dynamic: license-file
24
+
25
+ # Media Downloader - A2A & MCP Server
26
+
27
+ ![PyPI - Version](https://img.shields.io/pypi/v/media-downloader)
28
+ ![PyPI - Downloads](https://img.shields.io/pypi/dd/media-downloader)
29
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/media-downloader)
30
+ ![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/media-downloader)
31
+ ![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/media-downloader)
32
+ ![PyPI - License](https://img.shields.io/pypi/l/media-downloader)
33
+ ![GitHub](https://img.shields.io/github/license/Knuckles-Team/media-downloader)
34
+
35
+ ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/media-downloader)
36
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/media-downloader)
37
+ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/media-downloader)
38
+ ![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/media-downloader)
39
+
40
+ ![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/media-downloader)
41
+ ![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/media-downloader)
42
+ ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/media-downloader)
43
+ ![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/media-downloader)
44
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/media-downloader)
45
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/media-downloader)
46
+
47
+ *Version: 2.1.13*
48
+
49
+ Download videos and audio from the internet!
50
+
51
+ This package comes ready with an MCP Server and an A2A Server so you can plug this Agent into any of your existing agentic framework!
52
+
53
+ You can also plug in the MCP Server directly to your own agent if you prefer!
54
+
55
+ This repository is actively maintained - Contributions are welcome!
56
+
57
+ ### Supports:
58
+ - YouTube
59
+ - Twitter
60
+ - Rumble
61
+ - BitChute
62
+ - Vimeo
63
+ - And More!
64
+
65
+ <details>
66
+ <summary><b>Usage:</b></summary>
67
+
68
+ ### CLI
69
+ | Short Flag | Long Flag | Description |
70
+ |------------|-------------|---------------------------------------------|
71
+ | -h | --help | See usage |
72
+ | -a | --audio | Download audio only |
73
+ | -c | --channel | YouTube Channel/User - Downloads all videos |
74
+ | -f | --file | File with video links |
75
+ | -l | --links | Comma separated links |
76
+ | -d | --directory | Location to save videos |
77
+
78
+ ```bash
79
+ media-downloader --file "C:\Users\videos.txt" --directory "C:\Users\Downloads" --channel "WhiteHouse" --links "URL1,URL2,URL3"
80
+ ```
81
+
82
+ ### MCP CLI
83
+
84
+ | Short Flag | Long Flag | Description |
85
+ |------------|------------------------------------|-----------------------------------------------------------------------------|
86
+ | -h | --help | Display help information |
87
+ | -t | --transport | Transport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio) |
88
+ | -s | --host | Host address for HTTP transport (default: 0.0.0.0) |
89
+ | -p | --port | Port number for HTTP transport (default: 8000) |
90
+ | | --auth-type | Authentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none) |
91
+ | | --token-jwks-uri | JWKS URI for JWT verification |
92
+ | | --token-issuer | Issuer for JWT verification |
93
+ | | --token-audience | Audience for JWT verification |
94
+ | | --oauth-upstream-auth-endpoint | Upstream authorization endpoint for OAuth Proxy |
95
+ | | --oauth-upstream-token-endpoint | Upstream token endpoint for OAuth Proxy |
96
+ | | --oauth-upstream-client-id | Upstream client ID for OAuth Proxy |
97
+ | | --oauth-upstream-client-secret | Upstream client secret for OAuth Proxy |
98
+ | | --oauth-base-url | Base URL for OAuth Proxy |
99
+ | | --oidc-config-url | OIDC configuration URL |
100
+ | | --oidc-client-id | OIDC client ID |
101
+ | | --oidc-client-secret | OIDC client secret |
102
+ | | --oidc-base-url | Base URL for OIDC Proxy |
103
+ | | --remote-auth-servers | Comma-separated list of authorization servers for Remote OAuth |
104
+ | | --remote-base-url | Base URL for Remote OAuth |
105
+ | | --allowed-client-redirect-uris | Comma-separated list of allowed client redirect URIs |
106
+ | | --eunomia-type | Eunomia authorization type: 'none', 'embedded', 'remote' (default: none) |
107
+ | | --eunomia-policy-file | Policy file for embedded Eunomia (default: mcp_policies.json) |
108
+ | | --eunomia-remote-url | URL for remote Eunomia server |
109
+
110
+ ### Using as an MCP Server
111
+
112
+ The MCP Server can be run in two modes: `stdio` (for local testing) or `http` (for networked access). To start the server, use the following commands:
113
+
114
+ #### Run in stdio mode (default):
115
+ ```bash
116
+ media-downloader-mcp
117
+ ```
118
+
119
+ #### Run in HTTP mode:
120
+ ```bash
121
+ media-downloader-mcp --transport http --host 0.0.0.0 --port 8012
122
+ ```
123
+
124
+
125
+ AI Prompt:
126
+ ```text
127
+ Download me this video: https://youtube.com/watch?askdjfa
128
+ ```
129
+
130
+ AI Response:
131
+ ```text
132
+ Sure thing, the video has been downloaded to:
133
+
134
+ "C:\Users\User\Downloads\YouTube Video - Episode 1.mp4"
135
+ ```
136
+
137
+ ### Use in Python
138
+
139
+ ```python
140
+ # Import library
141
+ from media_downloader import MediaDownloader
142
+
143
+ # Set URL of video/audio here
144
+ url = "https://YootToob.com/video"
145
+
146
+ # Instantiate vide_downloader_instance
147
+ video_downloader_instance = MediaDownloader()
148
+
149
+ # Set the location to save the video
150
+ video_downloader_instance.set_save_path("C:/Users/you/Downloads")
151
+
152
+ # Add URL to download
153
+ video_downloader_instance.append_link(url)
154
+
155
+ # Download all videos appended
156
+ video_downloader_instance.download_all()
157
+ ```
158
+
159
+ ```python
160
+ # Optional - Set Audio to True, Default is False if unspecified.
161
+ video_downloader_instance.set_audio(audio=True)
162
+
163
+ # Optional - Open a file of video/audio URL(s)
164
+ video_downloader_instance.open_file("FILE")
165
+
166
+ # Optional - Enter a YouTube channel name and download their latest videos
167
+ video_downloader_instance.get_channel_videos("YT-Channel Name")
168
+ ```
169
+
170
+ ### Agent-to-Agent (A2A) Server
171
+
172
+ This package includes an Agent utilizing `pydantic-ai` that can be deployed as an A2A server. This agent is capable of using the `media-downloader` MCP server to fulfill media retrieval requests.
173
+
174
+ #### A2A CLI
175
+
176
+ | Long Flag | Description | Default |
177
+ |------------------|--------------------------------------------------|-----------------------------|
178
+ | --host | Host to bind the server to | 0.0.0.0 |
179
+ | --port | Port to bind the server to | 8000 |
180
+ | --reload | Enable auto-reload | False |
181
+ | --provider | LLM Provider (openai, anthropic, google, etc) | openai |
182
+ | --model-id | LLM Model ID | qwen3:4b |
183
+ | --base-url | LLM Base URL (for OpenAI compatible providers) | http://ollama.arpa/v1 |
184
+ | --api-key | LLM API Key | ollama |
185
+ | --mcp-url | MCP Server URL to connect to | http://media-downloader-mcp.arpa/mcp |
186
+ | --allowed-tools | List of allowed MCP tools | download_media |
187
+
188
+ #### Run A2A Server
189
+
190
+ ```bash
191
+ media-downloader-a2a --provider openai --model-id qwen2.5:7b --mcp-url http://localhost:8004/mcp
192
+ ```
193
+
194
+ ### Deploy MCP Server as a Service
195
+
196
+ The MCP server can be deployed using Docker, with configurable authentication, middleware, and Eunomia authorization.
197
+
198
+ #### Using Docker Run
199
+
200
+ ```bash
201
+ docker pull knucklessg1/media-downloader:latest
202
+
203
+ docker run -d \
204
+ --name media-downloader-mcp \
205
+ -p 8004:8004 \
206
+ -e HOST=0.0.0.0 \
207
+ -e PORT=8004 \
208
+ -e TRANSPORT=http \
209
+ -e AUTH_TYPE=none \
210
+ -e EUNOMIA_TYPE=none \
211
+ -e DOWNLOAD_DIRECTORY=/downloads \
212
+ -e AUDIO_ONLY=false \
213
+ -v "/home/genius/Downloads:/downloads" \
214
+ knucklessg1/media-downloader:latest
215
+ ```
216
+
217
+ For advanced authentication (e.g., JWT, OAuth Proxy, OIDC Proxy, Remote OAuth) or Eunomia, add the relevant environment variables:
218
+
219
+ ```bash
220
+ docker run -d \
221
+ --name media-downloader-mcp \
222
+ -p 8004:8004 \
223
+ -e HOST=0.0.0.0 \
224
+ -e PORT=8004 \
225
+ -e TRANSPORT=http \
226
+ -e AUTH_TYPE=oidc-proxy \
227
+ -e OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration \
228
+ -e OIDC_CLIENT_ID=your-client-id \
229
+ -e OIDC_CLIENT_SECRET=your-client-secret \
230
+ -e OIDC_BASE_URL=https://your-server.com \
231
+ -e ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/* \
232
+ -e EUNOMIA_TYPE=embedded \
233
+ -e EUNOMIA_POLICY_FILE=/app/mcp_policies.json \
234
+ -e DOWNLOAD_DIRECTORY=/downloads \
235
+ -e AUDIO_ONLY=false \
236
+ -v "/home/genius/Downloads:/downloads" \
237
+ knucklessg1/media-downloader:latest
238
+ ```
239
+
240
+ #### Using Docker Compose
241
+
242
+ Create a `docker-compose.yml` file:
243
+
244
+ ```yaml
245
+ services:
246
+ media-downloader-mcp:
247
+ image: knucklessg1/media-downloader:latest
248
+ environment:
249
+ - HOST=0.0.0.0
250
+ - PORT=8004
251
+ - TRANSPORT=http
252
+ - AUTH_TYPE=none
253
+ - EUNOMIA_TYPE=none
254
+ - DOWNLOAD_DIRECTORY=/downloads
255
+ - AUDIO_ONLY=false
256
+ volumes:
257
+ - "/home/genius/Downloads:/downloads"
258
+ ports:
259
+ - 8004:8004
260
+ ```
261
+
262
+ For advanced setups with authentication and Eunomia:
263
+
264
+ ```yaml
265
+ services:
266
+ media-downloader-mcp:
267
+ image: knucklessg1/media-downloader:latest
268
+ environment:
269
+ - HOST=0.0.0.0
270
+ - PORT=8004
271
+ - TRANSPORT=http
272
+ - AUTH_TYPE=oidc-proxy
273
+ - OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration
274
+ - OIDC_CLIENT_ID=your-client-id
275
+ - OIDC_CLIENT_SECRET=your-client-secret
276
+ - OIDC_BASE_URL=https://your-server.com
277
+ - ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/*
278
+ - EUNOMIA_TYPE=embedded
279
+ - EUNOMIA_POLICY_FILE=/app/mcp_policies.json
280
+ - DOWNLOAD_DIRECTORY=/downloads
281
+ - AUDIO_ONLY=false
282
+ ports:
283
+ - 8004:8004
284
+ volumes:
285
+ - ./mcp_policies.json:/app/mcp_policies.json
286
+ - "/home/genius/Downloads:/downloads"
287
+ ```
288
+
289
+ Run the service:
290
+
291
+ ```bash
292
+ docker-compose up -d
293
+ ```
294
+
295
+ #### Configure `mcp.json` for AI Integration
296
+
297
+
298
+ ```json
299
+ {
300
+ "mcpServers": {
301
+ "media_downloader": {
302
+ "command": "uv",
303
+ "args": [
304
+ "run",
305
+ "--with",
306
+ "media-downloader",
307
+ "media-downloader-mcp"
308
+ ],
309
+ "env": {
310
+ "DOWNLOAD_DIRECTORY": "~/Downloads", // Optional - Can be specified at prompt
311
+ "AUDIO_ONLY": false // Optional - Can be specified at prompt
312
+ },
313
+ "timeout": 300000
314
+ }
315
+ }
316
+ }
317
+
318
+ ```
319
+ </details>
320
+
321
+ <details>
322
+ <summary><b>Installation Instructions:</b></summary>
323
+
324
+ Install Python Package
325
+
326
+ ```bash
327
+ python -m pip install --upgrade media-downloader
328
+ ```
329
+
330
+ or
331
+
332
+ ```bash
333
+ uv pip install --upgrade media-downloader
334
+ ```
335
+
336
+ </details>
337
+
338
+ <details>
339
+ <summary><b>Repository Owners:</b></summary>
340
+
341
+
342
+ <img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />
343
+
344
+ ![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
345
+ ![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
346
+ </details>
@@ -0,0 +1,322 @@
1
+ # Media Downloader - A2A & MCP Server
2
+
3
+ ![PyPI - Version](https://img.shields.io/pypi/v/media-downloader)
4
+ ![PyPI - Downloads](https://img.shields.io/pypi/dd/media-downloader)
5
+ ![GitHub Repo stars](https://img.shields.io/github/stars/Knuckles-Team/media-downloader)
6
+ ![GitHub forks](https://img.shields.io/github/forks/Knuckles-Team/media-downloader)
7
+ ![GitHub contributors](https://img.shields.io/github/contributors/Knuckles-Team/media-downloader)
8
+ ![PyPI - License](https://img.shields.io/pypi/l/media-downloader)
9
+ ![GitHub](https://img.shields.io/github/license/Knuckles-Team/media-downloader)
10
+
11
+ ![GitHub last commit (by committer)](https://img.shields.io/github/last-commit/Knuckles-Team/media-downloader)
12
+ ![GitHub pull requests](https://img.shields.io/github/issues-pr/Knuckles-Team/media-downloader)
13
+ ![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/Knuckles-Team/media-downloader)
14
+ ![GitHub issues](https://img.shields.io/github/issues/Knuckles-Team/media-downloader)
15
+
16
+ ![GitHub top language](https://img.shields.io/github/languages/top/Knuckles-Team/media-downloader)
17
+ ![GitHub language count](https://img.shields.io/github/languages/count/Knuckles-Team/media-downloader)
18
+ ![GitHub repo size](https://img.shields.io/github/repo-size/Knuckles-Team/media-downloader)
19
+ ![GitHub repo file count (file type)](https://img.shields.io/github/directory-file-count/Knuckles-Team/media-downloader)
20
+ ![PyPI - Wheel](https://img.shields.io/pypi/wheel/media-downloader)
21
+ ![PyPI - Implementation](https://img.shields.io/pypi/implementation/media-downloader)
22
+
23
+ *Version: 2.1.13*
24
+
25
+ Download videos and audio from the internet!
26
+
27
+ This package comes ready with an MCP Server and an A2A Server so you can plug this Agent into any of your existing agentic framework!
28
+
29
+ You can also plug in the MCP Server directly to your own agent if you prefer!
30
+
31
+ This repository is actively maintained - Contributions are welcome!
32
+
33
+ ### Supports:
34
+ - YouTube
35
+ - Twitter
36
+ - Rumble
37
+ - BitChute
38
+ - Vimeo
39
+ - And More!
40
+
41
+ <details>
42
+ <summary><b>Usage:</b></summary>
43
+
44
+ ### CLI
45
+ | Short Flag | Long Flag | Description |
46
+ |------------|-------------|---------------------------------------------|
47
+ | -h | --help | See usage |
48
+ | -a | --audio | Download audio only |
49
+ | -c | --channel | YouTube Channel/User - Downloads all videos |
50
+ | -f | --file | File with video links |
51
+ | -l | --links | Comma separated links |
52
+ | -d | --directory | Location to save videos |
53
+
54
+ ```bash
55
+ media-downloader --file "C:\Users\videos.txt" --directory "C:\Users\Downloads" --channel "WhiteHouse" --links "URL1,URL2,URL3"
56
+ ```
57
+
58
+ ### MCP CLI
59
+
60
+ | Short Flag | Long Flag | Description |
61
+ |------------|------------------------------------|-----------------------------------------------------------------------------|
62
+ | -h | --help | Display help information |
63
+ | -t | --transport | Transport method: 'stdio', 'http', or 'sse' [legacy] (default: stdio) |
64
+ | -s | --host | Host address for HTTP transport (default: 0.0.0.0) |
65
+ | -p | --port | Port number for HTTP transport (default: 8000) |
66
+ | | --auth-type | Authentication type: 'none', 'static', 'jwt', 'oauth-proxy', 'oidc-proxy', 'remote-oauth' (default: none) |
67
+ | | --token-jwks-uri | JWKS URI for JWT verification |
68
+ | | --token-issuer | Issuer for JWT verification |
69
+ | | --token-audience | Audience for JWT verification |
70
+ | | --oauth-upstream-auth-endpoint | Upstream authorization endpoint for OAuth Proxy |
71
+ | | --oauth-upstream-token-endpoint | Upstream token endpoint for OAuth Proxy |
72
+ | | --oauth-upstream-client-id | Upstream client ID for OAuth Proxy |
73
+ | | --oauth-upstream-client-secret | Upstream client secret for OAuth Proxy |
74
+ | | --oauth-base-url | Base URL for OAuth Proxy |
75
+ | | --oidc-config-url | OIDC configuration URL |
76
+ | | --oidc-client-id | OIDC client ID |
77
+ | | --oidc-client-secret | OIDC client secret |
78
+ | | --oidc-base-url | Base URL for OIDC Proxy |
79
+ | | --remote-auth-servers | Comma-separated list of authorization servers for Remote OAuth |
80
+ | | --remote-base-url | Base URL for Remote OAuth |
81
+ | | --allowed-client-redirect-uris | Comma-separated list of allowed client redirect URIs |
82
+ | | --eunomia-type | Eunomia authorization type: 'none', 'embedded', 'remote' (default: none) |
83
+ | | --eunomia-policy-file | Policy file for embedded Eunomia (default: mcp_policies.json) |
84
+ | | --eunomia-remote-url | URL for remote Eunomia server |
85
+
86
+ ### Using as an MCP Server
87
+
88
+ The MCP Server can be run in two modes: `stdio` (for local testing) or `http` (for networked access). To start the server, use the following commands:
89
+
90
+ #### Run in stdio mode (default):
91
+ ```bash
92
+ media-downloader-mcp
93
+ ```
94
+
95
+ #### Run in HTTP mode:
96
+ ```bash
97
+ media-downloader-mcp --transport http --host 0.0.0.0 --port 8012
98
+ ```
99
+
100
+
101
+ AI Prompt:
102
+ ```text
103
+ Download me this video: https://youtube.com/watch?askdjfa
104
+ ```
105
+
106
+ AI Response:
107
+ ```text
108
+ Sure thing, the video has been downloaded to:
109
+
110
+ "C:\Users\User\Downloads\YouTube Video - Episode 1.mp4"
111
+ ```
112
+
113
+ ### Use in Python
114
+
115
+ ```python
116
+ # Import library
117
+ from media_downloader import MediaDownloader
118
+
119
+ # Set URL of video/audio here
120
+ url = "https://YootToob.com/video"
121
+
122
+ # Instantiate vide_downloader_instance
123
+ video_downloader_instance = MediaDownloader()
124
+
125
+ # Set the location to save the video
126
+ video_downloader_instance.set_save_path("C:/Users/you/Downloads")
127
+
128
+ # Add URL to download
129
+ video_downloader_instance.append_link(url)
130
+
131
+ # Download all videos appended
132
+ video_downloader_instance.download_all()
133
+ ```
134
+
135
+ ```python
136
+ # Optional - Set Audio to True, Default is False if unspecified.
137
+ video_downloader_instance.set_audio(audio=True)
138
+
139
+ # Optional - Open a file of video/audio URL(s)
140
+ video_downloader_instance.open_file("FILE")
141
+
142
+ # Optional - Enter a YouTube channel name and download their latest videos
143
+ video_downloader_instance.get_channel_videos("YT-Channel Name")
144
+ ```
145
+
146
+ ### Agent-to-Agent (A2A) Server
147
+
148
+ This package includes an Agent utilizing `pydantic-ai` that can be deployed as an A2A server. This agent is capable of using the `media-downloader` MCP server to fulfill media retrieval requests.
149
+
150
+ #### A2A CLI
151
+
152
+ | Long Flag | Description | Default |
153
+ |------------------|--------------------------------------------------|-----------------------------|
154
+ | --host | Host to bind the server to | 0.0.0.0 |
155
+ | --port | Port to bind the server to | 8000 |
156
+ | --reload | Enable auto-reload | False |
157
+ | --provider | LLM Provider (openai, anthropic, google, etc) | openai |
158
+ | --model-id | LLM Model ID | qwen3:4b |
159
+ | --base-url | LLM Base URL (for OpenAI compatible providers) | http://ollama.arpa/v1 |
160
+ | --api-key | LLM API Key | ollama |
161
+ | --mcp-url | MCP Server URL to connect to | http://media-downloader-mcp.arpa/mcp |
162
+ | --allowed-tools | List of allowed MCP tools | download_media |
163
+
164
+ #### Run A2A Server
165
+
166
+ ```bash
167
+ media-downloader-a2a --provider openai --model-id qwen2.5:7b --mcp-url http://localhost:8004/mcp
168
+ ```
169
+
170
+ ### Deploy MCP Server as a Service
171
+
172
+ The MCP server can be deployed using Docker, with configurable authentication, middleware, and Eunomia authorization.
173
+
174
+ #### Using Docker Run
175
+
176
+ ```bash
177
+ docker pull knucklessg1/media-downloader:latest
178
+
179
+ docker run -d \
180
+ --name media-downloader-mcp \
181
+ -p 8004:8004 \
182
+ -e HOST=0.0.0.0 \
183
+ -e PORT=8004 \
184
+ -e TRANSPORT=http \
185
+ -e AUTH_TYPE=none \
186
+ -e EUNOMIA_TYPE=none \
187
+ -e DOWNLOAD_DIRECTORY=/downloads \
188
+ -e AUDIO_ONLY=false \
189
+ -v "/home/genius/Downloads:/downloads" \
190
+ knucklessg1/media-downloader:latest
191
+ ```
192
+
193
+ For advanced authentication (e.g., JWT, OAuth Proxy, OIDC Proxy, Remote OAuth) or Eunomia, add the relevant environment variables:
194
+
195
+ ```bash
196
+ docker run -d \
197
+ --name media-downloader-mcp \
198
+ -p 8004:8004 \
199
+ -e HOST=0.0.0.0 \
200
+ -e PORT=8004 \
201
+ -e TRANSPORT=http \
202
+ -e AUTH_TYPE=oidc-proxy \
203
+ -e OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration \
204
+ -e OIDC_CLIENT_ID=your-client-id \
205
+ -e OIDC_CLIENT_SECRET=your-client-secret \
206
+ -e OIDC_BASE_URL=https://your-server.com \
207
+ -e ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/* \
208
+ -e EUNOMIA_TYPE=embedded \
209
+ -e EUNOMIA_POLICY_FILE=/app/mcp_policies.json \
210
+ -e DOWNLOAD_DIRECTORY=/downloads \
211
+ -e AUDIO_ONLY=false \
212
+ -v "/home/genius/Downloads:/downloads" \
213
+ knucklessg1/media-downloader:latest
214
+ ```
215
+
216
+ #### Using Docker Compose
217
+
218
+ Create a `docker-compose.yml` file:
219
+
220
+ ```yaml
221
+ services:
222
+ media-downloader-mcp:
223
+ image: knucklessg1/media-downloader:latest
224
+ environment:
225
+ - HOST=0.0.0.0
226
+ - PORT=8004
227
+ - TRANSPORT=http
228
+ - AUTH_TYPE=none
229
+ - EUNOMIA_TYPE=none
230
+ - DOWNLOAD_DIRECTORY=/downloads
231
+ - AUDIO_ONLY=false
232
+ volumes:
233
+ - "/home/genius/Downloads:/downloads"
234
+ ports:
235
+ - 8004:8004
236
+ ```
237
+
238
+ For advanced setups with authentication and Eunomia:
239
+
240
+ ```yaml
241
+ services:
242
+ media-downloader-mcp:
243
+ image: knucklessg1/media-downloader:latest
244
+ environment:
245
+ - HOST=0.0.0.0
246
+ - PORT=8004
247
+ - TRANSPORT=http
248
+ - AUTH_TYPE=oidc-proxy
249
+ - OIDC_CONFIG_URL=https://provider.com/.well-known/openid-configuration
250
+ - OIDC_CLIENT_ID=your-client-id
251
+ - OIDC_CLIENT_SECRET=your-client-secret
252
+ - OIDC_BASE_URL=https://your-server.com
253
+ - ALLOWED_CLIENT_REDIRECT_URIS=http://localhost:*,https://*.example.com/*
254
+ - EUNOMIA_TYPE=embedded
255
+ - EUNOMIA_POLICY_FILE=/app/mcp_policies.json
256
+ - DOWNLOAD_DIRECTORY=/downloads
257
+ - AUDIO_ONLY=false
258
+ ports:
259
+ - 8004:8004
260
+ volumes:
261
+ - ./mcp_policies.json:/app/mcp_policies.json
262
+ - "/home/genius/Downloads:/downloads"
263
+ ```
264
+
265
+ Run the service:
266
+
267
+ ```bash
268
+ docker-compose up -d
269
+ ```
270
+
271
+ #### Configure `mcp.json` for AI Integration
272
+
273
+
274
+ ```json
275
+ {
276
+ "mcpServers": {
277
+ "media_downloader": {
278
+ "command": "uv",
279
+ "args": [
280
+ "run",
281
+ "--with",
282
+ "media-downloader",
283
+ "media-downloader-mcp"
284
+ ],
285
+ "env": {
286
+ "DOWNLOAD_DIRECTORY": "~/Downloads", // Optional - Can be specified at prompt
287
+ "AUDIO_ONLY": false // Optional - Can be specified at prompt
288
+ },
289
+ "timeout": 300000
290
+ }
291
+ }
292
+ }
293
+
294
+ ```
295
+ </details>
296
+
297
+ <details>
298
+ <summary><b>Installation Instructions:</b></summary>
299
+
300
+ Install Python Package
301
+
302
+ ```bash
303
+ python -m pip install --upgrade media-downloader
304
+ ```
305
+
306
+ or
307
+
308
+ ```bash
309
+ uv pip install --upgrade media-downloader
310
+ ```
311
+
312
+ </details>
313
+
314
+ <details>
315
+ <summary><b>Repository Owners:</b></summary>
316
+
317
+
318
+ <img width="100%" height="180em" src="https://github-readme-stats.vercel.app/api?username=Knucklessg1&show_icons=true&hide_border=true&&count_private=true&include_all_commits=true" />
319
+
320
+ ![GitHub followers](https://img.shields.io/github/followers/Knucklessg1)
321
+ ![GitHub User's stars](https://img.shields.io/github/stars/Knucklessg1)
322
+ </details>