flashdata-dev commited on
Commit
b4cb4da
·
verified ·
1 Parent(s): c8dbcae

Clarify capability names and simplify documentation

Browse files
Files changed (4) hide show
  1. README.md +50 -48
  2. index.html +5 -5
  3. task.json +6 -5
  4. tool.py +1 -1
README.md CHANGED
@@ -1,12 +1,13 @@
1
  ---
2
- title: "YouTube video or audio delivery to cloud storage"
3
- emoji: 🔎
4
- colorFrom: blue
5
- colorTo: indigo
6
- sdk: static
7
- app_file: index.html
 
8
  pinned: false
9
- license: mit
10
  tags:
11
  - smolagents
12
  - tool
@@ -14,25 +15,27 @@ tags:
14
  - youtube-download
15
  ---
16
 
17
- # YouTube video or audio delivery to cloud storage — FlashData
18
 
19
- Deliver video or audio you are entitled to use into your own cloud storage for a downstream workflow. Submit once, save the job ID, and read status and the completed delivery manifest without resubmitting.
20
 
21
- **Try this task:** Submit a short MP4 clip to configured storage, then inspect its job and file manifest.
22
 
23
- [FlashData youtube download documentation](https://flashdata.dev/docs/sources/youtube_download?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-cloud-media-delivery-flashdata) · [Create a FlashData account](https://flashdata.dev/signup)
24
 
25
- ## Run it
26
 
27
- Open the Space to edit a request and inspect a documentation response sample. The interactive page runs locally in your browser; it does not send a FlashData query or collect an API key. The Python tool runs in your own process.
28
 
29
- Use Python 3.10 or newer. Install the pinned dependencies:
 
 
30
 
31
  ```sh
32
  python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
33
  ```
34
 
35
- Create an API key in the FlashData console, fund the required credits, and supply the key in your local environment. Review `tool.py` before enabling remote code execution.
36
 
37
  ```python
38
  import getpass
@@ -40,7 +43,7 @@ import os
40
  from smolagents import load_tool
41
 
42
  os.environ["FLASHDATA_API_KEY"] = getpass.getpass("FlashData API key: ")
43
- os.environ["FLASHDATA_DOWNLOAD_STORAGE"] = getpass.getpass("Customer storage JSON: ")
44
  tool = load_tool("flashdata-dev/youtube-cloud-media-delivery-flashdata", trust_remote_code=True)
45
  result = tool(**{'operation': 'submit',
46
  'parameters': {'end_at': '00:00:10',
@@ -51,54 +54,53 @@ result = tool(**{'operation': 'submit',
51
  print(result)
52
  ```
53
 
54
- This is a native smolagents Tool with typed task inputs. Add the loaded tool to your own agent; model choice, prompts and model fees remain under your control. Direct calls above do not need a model.
55
-
56
- ## Inputs
57
-
58
- | Parameter | Type | Required / default | Details |
59
- | --- | --- | --- | --- |
60
- | `video_id` | string | Required | 11-character YouTube video ID or a YouTube video URL. |
61
- | `download_type` | string | 'audio_video' | download type enum=['audio_video', 'video', 'audio'] |
62
- | `video_quality` | string | None | video quality pattern=^(best/worst/(?:<=/==/>=)(?:144/360/480/720/1080/1440/2160/4320))$ |
63
- | `fps` | string | None | fps pattern=^(?:>=/<=/==)(?:[1-9]\d?/1\d\d/2[0-3]\d/240)$ |
64
- | `audio_language` | string | None | audio language enum=['default', 'original'] |
65
- | `audio_quality` | string | None | audio quality enum=['best', '320', '256', '192', '128'] |
66
- | `yt_dlp_format` | string | None | yt dlp format |
67
- | `upload_metadata` | boolean | False | upload metadata |
68
- | `output_format` | string | None | output format enum=['mp4', 'webm', 'mkv', 'm4a', 'mp3', 'opus'] |
69
- | `start_at` | string | None | start at pattern=^\d{1,2}:[0-5]\d:[0-5]\d$ |
70
- | `end_at` | string | None | end at pattern=^\d{1,2}:[0-5]\d:[0-5]\d$ |
71
 
72
- Optional `None` values are omitted; the documented adapter defaults apply.
73
 
74
- Full validation rules are in `input-schema.json`.
75
 
76
- The tool accepts `operation` (`submit`, `status`, `result`), a `parameters` object containing the above media inputs for submission, and `job_id` for reads. Storage JSON is supplied outside these tool inputs. Supported storage providers: S3, S3-compatible, OSS, GCS, Azure, COS, BOS and TOS. Follow the [storage configuration documentation](https://flashdata.dev/docs/sources/youtube_download) for provider-specific credentials.
77
-
78
- After submission, save `result["id"]`. Then read without resubmitting:
79
 
80
  ```python
81
  saved_job_id = result["id"]
82
  status = tool(operation="status", job_id=saved_job_id)
 
83
  output = tool(operation="result", job_id=saved_job_id)
84
  ```
85
 
86
- In Windmill, select the same operation and job ID inputs in a later step. Pending/processing returns status. Completed output includes the JSON delivery manifest, with `file_url`, `file_size` and available media fields; the media stays in your storage.
 
 
 
 
87
 
88
- ## Output and next step
 
 
 
 
 
 
 
 
 
 
 
 
89
 
90
- The useful data is at `links`. Relevant fields: `rel`, `href`, `method`.
91
 
92
- Use operation=status or result with the saved job_id. A pending response is a reason to check later, not to submit another paid download. The result reader fetches JSON metadata, not the media file.
93
 
94
- The Space includes a recorded documentation example and its original request. It is not a fresh result for the task prompt above. Optional fields may be absent.
95
 
96
- ## Costs, limits and failures
97
 
98
- Asynchronous media download to customer storage; charged by delivered bytes, with storage charges separate. Storage credentials stay outside model-visible tool inputs. Use only media you have rights to process.
99
 
100
- The tool is MIT licensed. It is free to install. **FlashData API calls are paid**; installation does not include free data queries. Check current [FlashData pricing](https://flashdata.dev/pricing) and your console balance. Platform, model and customer storage charges are separate. Each search/page is a separate request; Extended Search has its own rate. Downloads are charged by delivered data volume.
101
 
102
- An uncertain timeout can still represent a charged request. Check Jobs in the FlashData console before trying again; this integration does not automatically retry paid submissions. A 401 means the key was rejected, 402 means insufficient credits, and 429 means a rate or quota limit.
103
 
104
- [Get started with this FlashData capability](https://flashdata.dev/docs/sources/youtube_download?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-cloud-media-delivery-flashdata)
 
1
  ---
2
+ title: "YouTube Download to Cloud Storage"
3
+ short_description: "Download video, audio or clips to your cloud storage."
4
+ emoji: "🔎"
5
+ colorFrom: "blue"
6
+ colorTo: "indigo"
7
+ sdk: "static"
8
+ app_file: "index.html"
9
  pinned: false
10
+ license: "mit"
11
  tags:
12
  - smolagents
13
  - tool
 
15
  - youtube-download
16
  ---
17
 
18
+ # YouTube Download to Cloud Storage
19
 
20
+ Download YouTube video, audio or clips to your own S3 or other supported cloud storage. Submit a job once, then read its status and delivery manifest.
21
 
22
+ [API documentation](https://flashdata.dev/docs/sources/youtube_download?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-cloud-media-delivery-flashdata) · [Get an API key](https://flashdata.dev/app/api-keys) · [Pricing](https://flashdata.dev/pricing)
23
 
24
+ Requires your own FlashData API key and paid Credits. The Python tool is free to install.
25
 
26
+ ## Try the inputs
27
 
28
+ Edit the JSON in this Space, generate a Python call, and inspect the included sample response or paste your own JSON. This page runs locally in your browser; it does not run a data query or collect your API key.
29
 
30
+ ## Run with Python
31
+
32
+ Use Python 3.10 or newer:
33
 
34
  ```sh
35
  python -m pip install "smolagents==1.26.0" "langchain-flashdata==0.2.1"
36
  ```
37
 
38
+ Review [tool.py](tool.py) before enabling `trust_remote_code`. Run locally with your key:
39
 
40
  ```python
41
  import getpass
 
43
  from smolagents import load_tool
44
 
45
  os.environ["FLASHDATA_API_KEY"] = getpass.getpass("FlashData API key: ")
46
+ os.environ["FLASHDATA_DOWNLOAD_STORAGE"] = getpass.getpass("Storage configuration JSON: ")
47
  tool = load_tool("flashdata-dev/youtube-cloud-media-delivery-flashdata", trust_remote_code=True)
48
  result = tool(**{'operation': 'submit',
49
  'parameters': {'end_at': '00:00:10',
 
54
  print(result)
55
  ```
56
 
57
+ The same loaded tool can be used with smolagents. A direct Python call does not require a model.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
+ ## Track the download
60
 
61
+ Supply storage credentials through `FLASHDATA_DOWNLOAD_STORAGE`, outside the public inputs. See [storage configuration](https://flashdata.dev/docs/sources/youtube_download?utm_source=hugging-face&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube-cloud-media-delivery-flashdata) for S3, S3-compatible, OSS, GCS, Azure, COS, BOS and TOS.
62
 
63
+ After submitting, save the job ID and read it without resubmitting:
 
 
64
 
65
  ```python
66
  saved_job_id = result["id"]
67
  status = tool(operation="status", job_id=saved_job_id)
68
+ # After completion:
69
  output = tool(operation="result", job_id=saved_job_id)
70
  ```
71
 
72
+ `submit` takes media `parameters`; `status` and `result` take only `job_id`. Completed output contains a delivery manifest with `file_url`, `file_size` and available media fields.
73
+
74
+ ## Inputs
75
+
76
+ The table below describes fields inside the `parameters` object for `operation="submit"`.
77
 
78
+ | Parameter | Required / default | Details |
79
+ | --- | --- | --- |
80
+ | `video_id` | Required | 11-character YouTube video ID or a YouTube video URL. |
81
+ | `download_type` | 'audio_video' | download type enum=['audio_video', 'video', 'audio'] |
82
+ | `video_quality` | None | video quality |
83
+ | `fps` | None | fps |
84
+ | `audio_language` | None | audio language enum=['default', 'original'] |
85
+ | `audio_quality` | None | audio quality enum=['best', '320', '256', '192', '128'] |
86
+ | `yt_dlp_format` | None | yt dlp format |
87
+ | `upload_metadata` | False | upload metadata |
88
+ | `output_format` | None | output format enum=['mp4', 'webm', 'mkv', 'm4a', 'mp3', 'opus'] |
89
+ | `start_at` | None | start at |
90
+ | `end_at` | None | end at |
91
 
92
+ See [input-schema.json](input-schema.json) for full validation rules. Optional `None` values are omitted; adapter defaults apply.
93
 
94
+ ## Output
95
 
96
+ Read `links`. Fields: `rel`, `href`, `method`. Optional fields may be absent.
97
 
98
+ [example.json](example.json) contains a recorded response and its original request, not a new result for the input shown in the Space.
99
 
100
+ ## Limits and cost
101
 
102
+ Requires your own writable storage and permission for your intended use. Downloads are asynchronous and charged by delivered data volume; storage charges are separate.
103
 
104
+ Check [current pricing](https://flashdata.dev/pricing) before running. Any model or hosting charges are separate.
105
 
106
+ For an uncertain timeout, check your FlashData Jobs before retrying; this tool does not automatically retry paid submissions.
index.html CHANGED
@@ -3,18 +3,18 @@
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <title>FlashData research tool</title>
7
  <link rel="stylesheet" href="style.css">
8
  </head>
9
  <body>
10
  <main>
11
- <header><a href="https://flashdata.dev" class="brand" target="_blank" rel="noopener">FLASHDATA</a><span>Research tools for AI agents</span></header>
12
- <section class="intro"><p class="eyebrow">SMOLAGENTS TOOL · PYTHON</p><h1 id="title">Loading tool…</h1><p id="scenario"></p><a id="docs" class="cta" target="_blank" rel="noopener">Get an API key and read the docs ↗</a></section>
13
  <div class="grid">
14
  <section class="panel"><h2>Build a request</h2><p id="task"></p><label for="parameters">Tool inputs (JSON)</label><textarea id="parameters" spellcheck="false"></textarea><button id="generate" type="button">Generate Python call</button><p id="input-status" role="status"></p><pre><code id="python"></code></pre><p class="hint">Run this code in your Python environment. Your API key is entered there, not on this page.</p></section>
15
- <section class="panel"><h2>Inspect the response</h2><p class="hint">This is a recorded documentation sample, not a live response to the request on the left. You can paste your own response JSON to explore its fields.</p><details><summary>Original sample request</summary><pre id="sample-request"></pre></details><label for="response">Response JSON</label><textarea id="response" spellcheck="false"></textarea><button id="inspect" type="button">Inspect results</button><p id="response-status" role="status"></p><div id="results"></div></section>
16
  </div>
17
- <section class="panel next"><h2>Use the result</h2><p id="next"></p><h3>Limits and costs</h3><p id="limit"></p><p>The tool is free to install. <strong>FlashData API calls are paid.</strong> Platform, model and customer storage costs are separate. No API or model call is made by this page. <a href="https://flashdata.dev/pricing" target="_blank" rel="noopener">Check pricing ↗</a></p><p>For an uncertain timeout, check Jobs before retrying a paid submission. Download jobs must be read with their saved ID; do not submit again while pending.</p></section>
18
  <footer><a id="source" target="_blank" rel="noopener">Review tool.py</a><a id="readme" target="_blank" rel="noopener">Installation and input reference</a><span>MIT licensed integration · FlashData API terms apply separately</span></footer>
19
  </main>
20
  <script type="module" src="app.js"></script>
 
3
  <head>
4
  <meta charset="UTF-8">
5
  <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <title>Search and video data tools</title>
7
  <link rel="stylesheet" href="style.css">
8
  </head>
9
  <body>
10
  <main>
11
+ <header><a href="https://flashdata.dev" class="brand" target="_blank" rel="noopener">FLASHDATA</a><span>Search &amp; video data</span></header>
12
+ <section class="intro"><p class="eyebrow">PYTHON TOOL · REQUEST EXAMPLES</p><h1 id="title">Loading tool…</h1><p id="scenario"></p><a id="docs" class="cta" target="_blank" rel="noopener">API documentation &amp; setup ↗</a></section>
13
  <div class="grid">
14
  <section class="panel"><h2>Build a request</h2><p id="task"></p><label for="parameters">Tool inputs (JSON)</label><textarea id="parameters" spellcheck="false"></textarea><button id="generate" type="button">Generate Python call</button><p id="input-status" role="status"></p><pre><code id="python"></code></pre><p class="hint">Run this code in your Python environment. Your API key is entered there, not on this page.</p></section>
15
+ <section class="panel"><h2>Inspect the response</h2><p class="hint">View the included sample or paste your own response JSON. Editing the request does not run a query.</p><details><summary>Original sample request</summary><pre id="sample-request"></pre></details><label for="response">Response JSON</label><textarea id="response" spellcheck="false"></textarea><button id="inspect" type="button">Inspect results</button><p id="response-status" role="status"></p><div id="results"></div></section>
16
  </div>
17
+ <section class="panel next"><h2>Use the result</h2><p id="next"></p><h3>Limits and costs</h3><p id="limit"></p><p>Requires your FlashData API key. <strong>Data calls use paid Credits.</strong> This page only prepares code and displays JSON. <a href="https://flashdata.dev/pricing" target="_blank" rel="noopener">Check pricing ↗</a></p><p>Check FlashData Jobs before retrying a request that timed out.</p></section>
18
  <footer><a id="source" target="_blank" rel="noopener">Review tool.py</a><a id="readme" target="_blank" rel="noopener">Installation and input reference</a><span>MIT licensed integration · FlashData API terms apply separately</span></footer>
19
  </main>
20
  <script type="module" src="app.js"></script>
task.json CHANGED
@@ -1,8 +1,8 @@
1
  {
2
  "slug": "youtube-cloud-media-delivery-flashdata",
3
- "title": "YouTube video or audio delivery to cloud storage \u2014 FlashData",
4
- "scenario": "Deliver video or audio you are entitled to use into your own cloud storage for a downstream workflow. Submit once, save the job ID, and read status and the completed delivery manifest without resubmitting.",
5
- "task": "Submit a short MP4 clip to configured storage, then inspect its job and file manifest.",
6
  "input": {
7
  "operation": "submit",
8
  "parameters": {
@@ -19,8 +19,9 @@
19
  "href",
20
  "method"
21
  ],
22
- "next": "Use operation=status or result with the saved job_id. A pending response is a reason to check later, not to submit another paid download. The result reader fetches JSON metadata, not the media file.",
23
- "limit": "Asynchronous media download to customer storage; charged by delivered bytes, with storage charges separate. Storage credentials stay outside model-visible tool inputs. Use only media you have rights to process.",
 
24
  "source": "youtube_download",
25
  "repo_id": "flashdata-dev/youtube-cloud-media-delivery-flashdata"
26
  }
 
1
  {
2
  "slug": "youtube-cloud-media-delivery-flashdata",
3
+ "title": "YouTube Download to Cloud Storage",
4
+ "scenario": "Download YouTube video, audio or clips to your own S3 or other supported cloud storage. Submit a job once, then read its status and delivery manifest.",
5
+ "task": "Prepare a download, or check an existing job ID.",
6
  "input": {
7
  "operation": "submit",
8
  "parameters": {
 
19
  "href",
20
  "method"
21
  ],
22
+ "next": "Save the submitted job ID. Select status or result to read that job without submitting it again.",
23
+ "limit": "Requires your own writable storage and permission for your intended use. Downloads are asynchronous and charged by delivered data volume; storage charges are separate.",
24
+ "short_description": "Download video, audio or clips to your cloud storage.",
25
  "source": "youtube_download",
26
  "repo_id": "flashdata-dev/youtube-cloud-media-delivery-flashdata"
27
  }
tool.py CHANGED
@@ -3,7 +3,7 @@ from smolagents import Tool
3
 
4
  class FlashDataTool(Tool):
5
  name = 'youtube_download'
6
- description = 'Deliver video or audio you are entitled to use into your own cloud storage for a downstream workflow. Submit once, save the job ID, and read status and the completed delivery manifest without resubmitting. Asynchronous media download to customer storage; charged by delivered bytes, with storage charges separate. Storage credentials stay outside model-visible tool inputs. Use only media you have rights to process. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
7
  inputs = {'job_id': {'description': 'Required for status/result. ID returned by a previous submit.',
8
  'nullable': True,
9
  'type': 'string'},
 
3
 
4
  class FlashDataTool(Tool):
5
  name = 'youtube_download'
6
+ description = 'Download YouTube video, audio or clips to your own S3 or other supported cloud storage. Submit a job once, then read its status and delivery manifest. Requires your own writable storage and permission for your intended use. Downloads are asynchronous and charged by delivered data volume; storage charges are separate. Uses paid FlashData API credits. Never automatically retry an uncertain submission; check Jobs first.'
7
  inputs = {'job_id': {'description': 'Required for status/result. ID returned by a previous submit.',
8
  'nullable': True,
9
  'type': 'string'},