Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Zoen-DEV/repurpose-youtube-video/llms.txt

Use this file to discover all available pages before exploring further.

The skill extracts everything it needs from a YouTube video locally — no Blotato API key is consumed during this step. Two Python libraries do the work: yt-dlp fetches video metadata, and youtube-transcript-api fetches the transcript. The result is a single dictionary that Claude uses to write both posts.

What gets extracted

bc.extract_youtube_local() returns the following dictionary:
{
    "title":       "Video title string",
    "description": "First 3 000 characters of the video description",
    "transcript":  "Full transcript as a single space-joined string",
    "summary":     "",          # always empty — Claude derives this from the transcript
    "keyPoints":   [],          # always empty — Claude derives these from the transcript
    "tags":        ["tag1", "tag2", ...],
    "chapters":    ["Chapter title 1", "Chapter title 2", ...],
    "channel":     "Channel or uploader name",
}
summary and keyPoints are intentionally empty in the returned dict. Claude reads the transcript directly and derives its own summary and key points — this avoids a redundant API call and keeps the extraction step free of credentials.

How extraction works

The function uses the yt-dlp Python API (not the CLI binary) to pull metadata without a separate PATH dependency, and youtube-transcript-api to fetch the transcript preferring Spanish variants first, then English, then any available language:
def extract_youtube_local(url: str) -> dict:
Usage in the skill workflow:
import re
cfg = bc.load_config()
clean_url = re.sub(r'[&?]t=\d+s?', '', url)
content = bc.extract_youtube_local(clean_url)
The timestamp parameter (&t=90s, ?t=90) is stripped from the URL before extraction to prevent yt-dlp from treating it as a seek offset. Neither library requires a YouTube API key — only yt-dlp and youtube-transcript-api must be installed:
python -m pip install yt-dlp youtube-transcript-api

Transcript fallback

If extract_youtube_local() raises an exception (private video, no subtitles, region-blocked content), the skill applies a two-step fallback:
  1. Strip to bare ?v= — removes any extra query parameters and retries the call once.
  2. Continue with title only — if the retry also fails, the skill prints an [aviso] and proceeds using only the video title:
[aviso] No se pudo extraer el transcript del video (puede que no tenga subtítulos o el video es privado).
        Continuaré con la información disponible del título.
The posts are still written, but without transcript data the faithful-citations rule has less source material to draw from. Any claims that cannot be verified against the transcript are either softened to general insights or dropped.

Language detection

The idioma: parameter controls which language the posts are written in.
ValueBehavior
esForce Spanish, skip detection
enForce English, skip detection
auto (default)Detect from content, as described below
When idioma: auto (or idioma: is absent), Claude inspects the transcript field first. If the transcript is empty, it falls back to title + description. Whichever language dominates the text becomes lang. Only es and en are supported output languages. If the source content appears to be in a third language (e.g. French, Portuguese, German), the skill defaults to es and warns:
[aviso] El video parece estar en <idioma> — escribiré los posts en español. Si prefieres otro idioma,
        vuelve a lanzar el comando con `idioma: en` o `idioma: es`.
After detection, the result is printed and stored:
[ok] Idioma detectado: es
The lang value ("es" or "en") is then used in Steps 4, 4.5, and 5 to write copy and render overlay text in the correct language.

Build docs developers (and LLMs) love