{"_id":"@flashdata-dev/youtube-captions","_rev":"6-004af3e4558d9a76fdafca1acc121270","name":"@flashdata-dev/youtube-captions","dist-tags":{"latest":"0.2.1"},"versions":{"0.0.0-stage":{"name":"@flashdata-dev/youtube-captions","version":"0.0.0-stage","_id":"@flashdata-dev/youtube-captions@0.0.0-stage","stub":true,"maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"dist":{"shasum":"affc06002f89e2fcd8c4a39eb1bc6bd46dab79c2","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-IJOkM933xQpOJQx5tk86n1TRyWDAG0Wq6kEw83bMWsl6XIYJt3oZ6ekmsBe4Ti8E/gqFybq+21aNnaFHATruuw==","signatures":[{"sig":"MEQCIDqDhAf6z1xSUlIERWvtZNP2WvWvdHWQjYrPQsEtRJy0AiAMbfxntg88lNUSFdaf15dtO7Rec7BtX5s/5TnZOZ/npA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":353},"_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"0.1.0":{"name":"@flashdata-dev/youtube-captions","version":"0.1.0","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"author":{"name":"FlashData","email":"support@flashdata.dev"},"license":"MIT","_id":"@flashdata-dev/youtube-captions@0.1.0","maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","bugs":{"url":"https://github.com/flashdata-dev/flashdata-mcp/issues"},"bin":{"flashdata-youtube-captions":"bin/run.js"},"dist":{"shasum":"7d2f84157e52e6cbbe37a30c3a12acefc1aaf4e7","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.1.0.tgz","fileCount":24,"integrity":"sha512-rWDmjsJ5m1fGs7zlkHdTdUTri6vpqhMUG8sxdNoLpek4z4alBO2ofoKkbduF0eoF1iyus6C9sl2enot2JiP3MA==","signatures":[{"sig":"MEUCIAk5q+uPdefnJpGcooTmyc6alMnS8vicev8S9CFt9qOsAiEAy6j32K5axqWnmG/oACQVfGTeC3lS7R4dQcEuMUaesCo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFMPXGmTuGPrDMkc6alBSlqPZoWLaAIEhEg5WFQsvDHWAiBdrv9GlmlMxdHLPkxryO8xNcEyfxN3JzYJSDavlMXXEg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73392},"type":"commonjs","_from":"file:/Users/rocosen/Documents/GitHub/flashdata-mcp/dist/npm-reviewed/flashdata-dev-youtube-captions-0.1.0.tgz","engines":{"node":">=22.18.0"},"exports":{"./package.json":"./package.json"},"_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"_resolved":"/Users/rocosen/Documents/GitHub/flashdata-mcp/dist/npm-reviewed/flashdata-dev-youtube-captions-0.1.0.tgz","_integrity":"sha512-rWDmjsJ5m1fGs7zlkHdTdUTri6vpqhMUG8sxdNoLpek4z4alBO2ofoKkbduF0eoF1iyus6C9sl2enot2JiP3MA==","repository":{"url":"git+https://github.com/flashdata-dev/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"_npmVersion":"11.12.1","description":"Retrieve YouTube uploader captions with timed segments. Prepare subtitle exports and inspect the language and caption-track type. CLI and MCP via the paid FlashData API.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"ajv":"8.20.0","axios":"1.20.0","@modelcontextprotocol/sdk":"1.31.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/youtube-captions_0.1.0_1791987330802_0.6562688726173564","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@flashdata-dev/youtube-captions","version":"0.1.1","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"author":{"name":"FlashData","email":"support@flashdata.dev"},"license":"MIT","_id":"@flashdata-dev/youtube-captions@0.1.1","maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","bugs":{"url":"https://github.com/rocosen/flashdata-mcp/issues"},"bin":{"flashdata-youtube-captions":"bin/run.js"},"dist":{"shasum":"02e7a66bc0963e2ebc6c7fcf9d4313610b9bc7f1","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.1.1.tgz","fileCount":24,"integrity":"sha512-rfvssreSP2GQEiutEnFqh4Pt7e6/BoTQCiEaaquk4vAlp99nN4jEh9n0BZrMAoPvzo8zr183SMcQcR9w0JTm5w==","signatures":[{"sig":"MEUCIHGC6tMmYoz8zXMqJKA4pKr3uv/v04OX/mqnIMT4xA6VAiEA54zMrtRFkIIYr+xpu9+o25sW0xYyFjpn1OmBWtSWC6s=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDpZToBuXDzIBXKMbEPoBalitYjPQq4IJ+xe+E1YhaWZwIhAJQvhqhHQK+/jWY7jK0CCq6kNgO38EkIS+yY6lzRgYxn","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":74200},"type":"commonjs","_from":"file:/Users/rocosen/Documents/FlashData/channels/python-examples-20261019/npm-artifacts-0.1.1-verified/flashdata-dev-youtube-captions-0.1.1.tgz","engines":{"node":">=22.18.0"},"exports":{"./package.json":"./package.json"},"_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"_resolved":"/Users/rocosen/Documents/FlashData/channels/python-examples-20261019/npm-artifacts-0.1.1-verified/flashdata-dev-youtube-captions-0.1.1.tgz","_integrity":"sha512-rfvssreSP2GQEiutEnFqh4Pt7e6/BoTQCiEaaquk4vAlp99nN4jEh9n0BZrMAoPvzo8zr183SMcQcR9w0JTm5w==","repository":{"url":"git+https://github.com/rocosen/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"_npmVersion":"11.19.0","description":"Retrieve YouTube uploader captions with timed segments. Prepare subtitle exports and inspect the language and caption-track type. CLI and MCP via the paid FlashData API.","directories":{},"_nodeVersion":"24.21.0","dependencies":{"ajv":"8.20.0","axios":"1.20.0","@modelcontextprotocol/sdk":"1.31.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/youtube-captions_0.1.1_1792397256948_0.7022721740110887","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@flashdata-dev/youtube-captions","version":"0.1.2","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"author":{"name":"FlashData","email":"support@flashdata.dev"},"license":"MIT","_id":"@flashdata-dev/youtube-captions@0.1.2","maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","bugs":{"url":"https://github.com/rocosen/flashdata-mcp/issues"},"bin":{"flashdata-youtube-captions":"bin/run.js"},"dist":{"shasum":"840ce0691b44c294790a2648992081fb5559e7ab","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.1.2.tgz","fileCount":25,"integrity":"sha512-AgRIjCnhCUAE7QhBcpHP0y6uJnAMjSWcROxR1RDpqxLLyIn4ha2URN4FJtlBTOVwmNChUCzeeFf0tDZrtWwrDg==","signatures":[{"sig":"MEYCIQCavsJWfG2r6D7NoOvlo5UWCRmIWtT/V4tt+Dv9PjOPOAIhAOuBO8JaLny0UbgePbIV7YTy04oxCVHFmjTGli8mTW8I","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFNZ+mvV9sf2btnCuiPfIRPvhW695mic4YVEFK+PjzbuAiEAiB8/QGz9qsUycva4XZu060uRMZg60w4vp3Aa//faHbE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":73466},"type":"commonjs","_from":"file:/Users/rocosen/Documents/FlashData/channels/npm-copy-20261104/artifacts/flashdata-dev-youtube-captions-0.1.2.tgz","engines":{"node":">=22.18.0"},"exports":{"./package.json":"./package.json"},"_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"_resolved":"/Users/rocosen/Documents/FlashData/channels/npm-copy-20261104/artifacts/flashdata-dev-youtube-captions-0.1.2.tgz","_integrity":"sha512-AgRIjCnhCUAE7QhBcpHP0y6uJnAMjSWcROxR1RDpqxLLyIn4ha2URN4FJtlBTOVwmNChUCzeeFf0tDZrtWwrDg==","repository":{"url":"git+https://github.com/rocosen/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"_npmVersion":"11.12.1","description":"Get existing YouTube captions with timed segments. Selects uploader-provided captions by default. CLI and MCP via FlashData.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"ajv":"8.20.0","axios":"1.20.0","@modelcontextprotocol/sdk":"1.32.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/youtube-captions_0.1.2_1793767798058_0.2811540405808858","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@flashdata-dev/youtube-captions","version":"0.2.0","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"author":{"name":"FlashData","email":"support@flashdata.dev"},"license":"MIT","_id":"@flashdata-dev/youtube-captions@0.2.0","maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","bugs":{"url":"https://github.com/flashdatadev/flashdata-mcp/issues"},"bin":{"flashdata-youtube-captions":"bin/run.js"},"dist":{"shasum":"f955f20c19c60cb9ef8f02ab9be8da0b5b9c06ae","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.2.0.tgz","fileCount":27,"integrity":"sha512-jXuzreU/CpRDC0EL/hEWRIO55I2ZOfg6VO18HNHh6oRQWBCBn+/uVyR6PkU1bMqiOLH91sH86WWsC1N2gKrAhA==","signatures":[{"sig":"MEUCIQCdPruDvOONVTJPo+BAdMcK5R+Zzz+y3dwbV5ZPINEUngIgC8hHRUEp7Do+DU/qxwDglmZ11OHV9P3v9hzCt2+tt/M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIE+r/eXeVAxYCA3BpiNJPxfFXHwG+iycUd2R5Kv3vlK1AiEAz4U9aAqTPYWS1KWRnirBgPcB/VlMIMfLrIqYVJJzJqQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":95354},"type":"commonjs","_from":"file:/Users/rocosen/Documents/GitHub/datanity/outputs/registry-publish-20261105/npm/flashdata-dev-youtube-captions-0.2.0.tgz","engines":{"node":">=22.18.0"},"exports":{"./package.json":"./package.json"},"_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"_resolved":"/Users/rocosen/Documents/GitHub/datanity/outputs/registry-publish-20261105/npm/flashdata-dev-youtube-captions-0.2.0.tgz","_integrity":"sha512-jXuzreU/CpRDC0EL/hEWRIO55I2ZOfg6VO18HNHh6oRQWBCBn+/uVyR6PkU1bMqiOLH91sH86WWsC1N2gKrAhA==","repository":{"url":"git+https://github.com/flashdatadev/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"_npmVersion":"11.12.1","description":"Retrieve YouTube uploader captions with timed segments. Prepare subtitle exports and inspect the language and caption-track type. CLI and MCP via the paid FlashData API.","directories":{},"_nodeVersion":"25.9.0","dependencies":{"ajv":"8.20.0","axios":"1.20.0","@modelcontextprotocol/sdk":"1.32.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/youtube-captions_0.2.0_1793896168480_0.2645663405196764","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"_id":"@flashdata-dev/youtube-captions@0.2.1","bin":{"flashdata-youtube-captions":"bin/run.js"},"bugs":{"url":"https://github.com/flashdatadev/flashdata-mcp/issues"},"dist":{"shasum":"53b243c56599cb6d982465befa5cf4984bbd4d59","tarball":"https://registry.npmjs.org/@flashdata-dev/youtube-captions/-/youtube-captions-0.2.1.tgz","fileCount":27,"integrity":"sha512-scYcjxE3PgUhOOhb37Mo6XxQr/FdaX8XrXeWHQ6uu/A2zq+x4fIrCpHzCzE+sDHOXzKcNqpUYBy8gC2ao90zSQ==","signatures":[{"sig":"MEQCIB95bC8VlOCtce4k9faSHikZd60mzUjMvxME4yk+7/15AiBJp/1c5q1x7LxzoUxvh7ycpS/tafrakrT9ORhsW4mSAw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD1JoQqiKHy3MDo6eTTvjS8WeOBjyToVgJnB38iovVCswIhAPVqP6RlTdFJT5tLK1mFZyqCHrhqEaJ7Dj1ngS/yOvBs"}],"unpackedSize":93900},"name":"@flashdata-dev/youtube-captions","type":"commonjs","_from":"file:/Users/rocosen/Documents/FlashData/channels/github-npm-attribution-20261109/release/tasks/flashdata-dev-youtube-captions-0.2.1.tgz","author":{"name":"FlashData","email":"support@flashdata.dev"},"engines":{"node":">=22.18.0"},"exports":{"./package.json":"./package.json"},"license":"MIT","version":"0.2.1","_npmUser":{"name":"flashdata-dev","email":"rocosenyy@gmail.com"},"homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"_resolved":"/Users/rocosen/Documents/FlashData/channels/github-npm-attribution-20261109/release/tasks/flashdata-dev-youtube-captions-0.2.1.tgz","_integrity":"sha512-scYcjxE3PgUhOOhb37Mo6XxQr/FdaX8XrXeWHQ6uu/A2zq+x4fIrCpHzCzE+sDHOXzKcNqpUYBy8gC2ao90zSQ==","repository":{"url":"git+https://github.com/flashdatadev/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"_npmVersion":"11.12.1","description":"Retrieve YouTube uploader captions with timed segments. Prepare subtitle exports and inspect the language and caption-track type. CLI and MCP via the paid FlashData API.","directories":{},"maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"_nodeVersion":"25.9.0","dependencies":{"ajv":"8.20.0","axios":"1.20.0","@modelcontextprotocol/sdk":"1.32.1"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/youtube-captions_0.2.1_1794203370139_0.5743368341905066"}}},"time":{"created":"2026-10-14T14:13:53.012Z","modified":"2026-11-09T05:49:30.379Z","0.0.0-stage":"2026-10-14T14:13:53.012Z","0.1.0":"2026-10-14T14:15:30.878Z","0.1.1":"2026-10-19T08:07:37.060Z","0.1.2":"2026-11-04T04:49:58.146Z","0.2.0":"2026-11-05T16:29:28.559Z","0.2.1":"2026-11-09T05:49:30.219Z"},"bugs":{"url":"https://github.com/flashdatadev/flashdata-mcp/issues"},"author":{"name":"FlashData","email":"support@flashdata.dev"},"license":"MIT","homepage":"https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task","keywords":["youtube-captions","youtube-manual-captions","cli","mcp","model-context-protocol","flashdata"],"repository":{"url":"git+https://github.com/flashdatadev/flashdata-mcp.git","type":"git","directory":"npm/docs/youtube-captions"},"description":"Retrieve YouTube uploader captions with timed segments. Prepare subtitle exports and inspect the language and caption-track type. CLI and MCP via the paid FlashData API.","maintainers":[{"name":"flashdata-dev","email":"rocosenyy@gmail.com"}],"readme":"# YouTube Captions CLI and MCP — FlashData\n\nRetrieve an existing uploader-provided caption track, then format its timed segments locally. The API returns JSON; the example below performs the SRT conversion without a second data call.\n\n`@flashdata-dev/youtube-captions` exposes **youtube_captions** and the supporting reads for that task. It runs locally and calls the FlashData API. Node.js **22.18 or newer** and a FlashData API key with this source enabled are required.\n\n[Inputs, outputs and source documentation](https://flashdata.dev/docs/sources/youtube_captions?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task) · [Get an API key](https://flashdata.dev/signup?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task) · [Current API pricing](https://flashdata.dev/pricing?utm_source=npm&utm_medium=integration&utm_campaign=intent_gtm_2026q4&utm_content=youtube_captions-task)\n\n**The MIT software is free to install. FlashData API data calls are paid and consume Credits.** Pricing and job reads are free. MCP client/model fees are separate.\n\n## Run with npx\n\nSet `FLASHDATA_API_KEY` in your shell environment or secret manager. Keep the real value out of chat, committed files and command arguments. These first checks do not submit a data query:\n\n```sh\nnpx --yes @flashdata-dev/youtube-captions@0.2.1 --help\nnpx --yes @flashdata-dev/youtube-captions@0.2.1 tools\nnpx --yes @flashdata-dev/youtube-captions@0.2.1 call get_pricing\n```\n\nSave the following as `query.json`. It uses flat tool arguments; no REST `params` wrapper is needed.\n\n```json\n{\n  \"video_id\": \"dQw4w9WgXcQ\",\n  \"language\": \"en\",\n  \"auto\": false\n}\n```\n\nThis command performs **one paid data request** and writes its response to a file:\n\n```sh\nnpx --yes @flashdata-dev/youtube-captions@0.2.1 call youtube_captions --input query.json > result.json\n```\n\nUse `--input -` to read JSON from stdin. For a local project installation, run `npm install @flashdata-dev/youtube-captions@0.2.1` and use `npx flashdata-youtube-captions` with the same arguments.\n\n## Convert uploader captions to an SRT file\n\nThe CLI returns `{\"ok\":true,\"tool\":\"...\",\"result\":...}`. Check `ok` and the API/job status before consuming data. Use Python **3.10 or newer**; only the standard library is needed. Save this as `process-result.py` beside `result.json` and run `python3 process-result.py` (Windows: `py -3 process-result.py`). The script reads the saved CLI response; it makes no API call. Missing optional fields in JSON summaries are represented as `null`:\n\n```python\nimport json\nfrom pathlib import Path\n\nresponse = json.loads(Path(\"result.json\").read_text(encoding=\"utf-8\"))\nif not response.get(\"ok\"):\n    raise SystemExit(\"The request failed; inspect the response before retrying.\")\nresult = response[\"result\"]\nif \"job\" in result:\n    status = result[\"job\"][\"status\"]\n    if status != \"completed\":\n        raise SystemExit(f\"Job status: {status}. Inspect this job; do not resubmit.\")\n    result = result[\"output\"]\nif result.get(\"status\") not in (None, \"done\"):\n    raise SystemExit(\"No completed data yet. Read the existing job before processing.\")\nif not result.get(\"results\"):\n    raise SystemExit(\"No result record was returned.\")\ndata = result[\"results\"][0]\n\nimport math\n\ndef timestamp(seconds):\n    milliseconds = math.floor(seconds * 1000 + 0.5)\n    hours, remainder = divmod(milliseconds, 3_600_000)\n    minutes, remainder = divmod(remainder, 60_000)\n    seconds, milliseconds = divmod(remainder, 1000)\n    return f\"{hours:02}:{minutes:02}:{seconds:02},{milliseconds:03}\"\n\nfor number, segment in enumerate(data.get(\"segments\") or [], start=1):\n    print(number)\n    print(f\"{timestamp(segment['start'])} --> {timestamp(segment['end'])}\")\n    print(segment[\"text\"])\n    print()\n```\n\nSelected fields from a **representative fixture**, not a live response or a guarantee that every field/result will be present. This is the content inside the CLI's `result` property:\n\n```json\n{\n  \"source\": \"youtube_captions\",\n  \"status\": \"done\",\n  \"results\": [\n    {\n      \"videoId\": \"dQw4w9WgXcQ\",\n      \"languageCode\": \"en\",\n      \"isAutoGenerated\": false,\n      \"segments\": [\n        {\n          \"start\": 0,\n          \"end\": 3,\n          \"text\": \"Uploader captions.\"\n        }\n      ]\n    }\n  ],\n  \"created_at\": \"2026-10-12T00:00:00Z\",\n  \"http_status\": 200,\n  \"request_id\": \"fixture-request\"\n}\n```\n\nauto=false selects existing uploader captions. This does not generate, translate or automatically substitute a missing track.\n\n## Parameters\n\n| Parameter | Type | Required | Default and constraints |\n| --- | --- | --- | --- |\n| `video_id` | string | Yes | Pattern: `^[A-Za-z0-9_-]{11}$`. |\n| `language` | string or array | No | One exact code or 1–10 distinct codes. Omit to prefer en-orig, then en. |\n| `auto` | boolean | No | Default: `false`. true selects automatically generated captions; false selects manually provided captions. Does not fall back between the two. |\n| `mode` | string | No | Default: `\"realtime\"`. Allowed: `realtime`, `async`. |\n\nThe package includes `schema.json` with the complete nested schema and `examples/query.json`. The `tools` command also returns the current schemas permitted by your key. Fields supplied by the remote source may be missing; preserve original values and source links.\n\n## Jobs, errors and billing\n\nFor a longer-running query, set `mode` to `\"async\"`. Save the returned `result.id`, create `job.json` with that job ID, and read it without submitting again:\n\n```json\n{\"job_id\":\"job_REPLACE_WITH_RETURNED_ID\"}\n```\n\n```sh\nnpx --yes @flashdata-dev/youtube-captions@0.2.1 call get_job --input job.json > result.json\n```\n\n`pending` or `processing` means wait and read the same job later; `completed` provides the original JSON under `result.output`. The package never polls or retries paid submissions automatically. A timeout or lost response may still represent charged work: check Jobs before another submission. Each submitted query is charged at this source’s current rate; the number of returned records is not the request count.\n\nCLI exit codes are 0 for a successful operation, 1 for an API/tool failure and 2 for invalid local input/configuration. Input is limited to 256 KiB and each API response to 4 MiB. CLI outputs complete JSON. Async JSON results have a 24-hour availability window.\n\n## Connect an MCP client\n\nThis same package starts a persistent stdio server with the `mcp` subcommand:\n\n```json\n{\n  \"mcpServers\": {\n    \"youtube-captions\": {\n      \"command\": \"npx\",\n      \"args\": [\n        \"--yes\",\n        \"@flashdata-dev/youtube-captions@0.2.1\",\n        \"mcp\"\n      ],\n      \"env\": {\n        \"FLASHDATA_API_KEY\": \"YOUR_API_KEY\"\n      }\n    }\n  }\n}\n```\n\nUse `npx.cmd` on Windows if your client requires it. Enter your own key through protected client settings. The four tools are `youtube_captions`, `get_pricing`, `get_job` and `get_result`; the source is fixed, and job reads reject jobs belonging to other sources. API key permissions are rechecked on each operation.\n\nMCP responses longer than 16,000 UTF-16 code units use `result_id`, `chunk` and `next_offset`. Read the remaining chunks with `get_result` in the same running server, concatenate them in order, and parse only `encoding: \"json\"`. Other encodings are Markdown or plain-text documents. The process retains at most four results for ten minutes. The one-shot CLI has no `get_result` command because it returns the whole response.\n\nOptional environment settings are `FLASHDATA_REQUEST_TIMEOUT_MS` (1000–120000, default 65000), `FLASHDATA_DATA_API_URL` and `FLASHDATA_MANAGEMENT_API_URL`. Custom URLs must be trusted HTTPS origins; loopback HTTP is accepted for local tests. The package does not load `.env` files automatically.\n\nSupport: [support@flashdata.dev](mailto:support@flashdata.dev) · [Source and issue tracker](https://github.com/flashdatadev/flashdata-mcp) · [FlashData terms](https://flashdata.dev/legal/terms) · [Privacy](https://flashdata.dev/legal/privacy). This is an independent FlashData integration, not an official Google or YouTube package.\n\n## MCP presentation\n\nTask MCP 0.2.0 default to Markdown text while retaining original\nfields in `structuredContent`. Use `response_format: \"text\"` or `\"json\"` for another\npresentation; `get_result` inherits the original format. Earlier published\nversions return JSON and do not accept this argument: check the running tool\nschema before using it. CLI calls default to JSON; explicit text formats return\na document string in the JSON `result` field. Formatting never repeats the query.\n\n## Language lists\n\nUse `language: [\"en\", \"es\"]` to request several tracks. Omit language to prefer `en-orig`, then `en`, returning one track. A string selects exactly that language and keeps the single-track response. Lists, including one-element lists, return `tracks` and per-language `errors` inside each result. Keep successful tracks and inspect errors; when all fail, tracks is empty. The selected caption source applies to every language.\n","readmeFilename":"README.md"}