task icon Task

Extract YouTube Transcript

Requirements
YouTube video URL
Instructions
You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).
3

Present the transcript to the user with timestamps. For long transcripts,
offer to summarize or search for specific topics.

If the code returned an error (no captions found), inform the user that this
video doesn't have captions available and suggest trying a different video.

After presenting, rename the file to a semantic filename based on the video
title (e.g., rename _latest.json to "is-nato-collapsing.json" in the same directory).

                    To run this task you must have the following required information:

> YouTube video URL

If you don't have all of this information, exit here and respond asking for any extra information you require, and instructions to run this task again with ALL required information.

---

You MUST use a todo list to complete these steps in order. Never move on to one step if you haven't completed the previous step. If you have multiple read steps in a row, read them all at once (in parallel).

Add all steps to your todo list now and begin executing.

## Steps

1. [Gather Arguments: Fetch YouTube Transcript] The next step has the following requirements for arguments, do not proceed until you have all the required information:
- `url`: YouTube video URL from user
- `output_path` (default: "session/transcript.json"): ./documents/transcripts/youtube/_latest.json
- Packages: youtube-transcript-api

2. [Run Code: Fetch YouTube Transcript]: Call `run_script` with:

```json
{
  "file": {
    "path": https://sk.ills.app/code/media.youtube.fetch/preview,
    "args": [
      "url",
      "output_path"
    ]
  },
  "packages": ["youtube-transcript-api"]
}
```

3. [Read YouTube Transcripts]: Read the file at `./documents/transcripts/youtube/_latest.json` and analyze its contents

4. Present the transcript to the user with timestamps. For long transcripts,
offer to summarize or search for specific topics.

If the code returned an error (no captions found), inform the user that this
video doesn't have captions available and suggest trying a different video.

After presenting, rename the file to a semantic filename based on the video
title (e.g., rename _latest.json to "is-nato-collapsing.json" in the same directory).