Analyze YouTube videos, web pages (blog posts, articles), or local files (TXT, HTML, PDF) using Google Gemini API. Extracts key takeaways, summaries, code, prompts, and more.
Analyze YouTube videos, web pages (blog posts, articles), or local files (TXT, HTML, PDF) using Google Gemini API. Extracts key takeaways, summaries, code, prompts, and more.
triggers
["summarize youtube video","summarize youtube","summarize transcript","analyze youtube","analyze video","yt summary","yt transcript","youtube takeaways","extract from video","summarize article","summarize blog post","analyze web page","analyze url"]
YouTube, Web & File Content Analyzer
Analyze YouTube videos, web pages (blog posts, articles), or local files (TXT, HTML, PDF) using Google Gemini API via the yt_analyze.py CLI tool.
Script Location
The script and supporting files are co-located with this skill:
URL and --file are mutually exclusive — the script enforces this.
Source Type Detection
The script automatically detects the source type:
YouTube URL (youtube.com, youtu.be) → sends video directly to Gemini via file_data
Web page URL (any other http/https URL) → fetches the page, extracts text (strips HTML), sends text to Gemini
Local file (--file) → reads the file based on extension:
.txt, .md, .json, .csv, etc. → read as plain text
.html, .htm → parse HTML tags, extract text content
.pdf → extract text from all pages using pdfplumber
Multiple URLs
The user may provide multiple URLs in a single request, separated by commas, spaces, or newlines. They can be a mix of YouTube and web page URLs. For example:
Parse all URLs from the input (split on commas, spaces, or newlines; filter to valid URLs).
Process each URL sequentially — run a separate python yt_analyze.py "URL" <shared-flags> command for each URL. All other flags (e.g., -p, --builtin, --transcript) apply to every URL.
Report progress — after each URL completes, tell the user which source finished and its output file path before moving to the next.
Summarize at the end — after all sources are processed, list all output file paths together.
Do not run multiple URLs in parallel — the Gemini API may rate-limit concurrent requests.
Prompt Resolution Order
If the user says "transcript mode" or wants a transcript → use --transcript
If the user names a built-in preset → use --builtin <preset>
If the user provides an inline prompt → use -p "their prompt"
Otherwise → omit prompt flags (the script defaults to reading my_prompt.txt)
The output .md file will be written to the user's current working directory. The script prints the output path to stderr. After execution, tell the user the output file path.
Important: Never output files to the skill's scripts directory. Always run from the user's cwd.