/tube-scholar:tube-scholarfrom tube-scholar
Turns YouTube, TED, Udemy, Coursera, and other video links into bilingual (Arabic/English) study guides with summaries, flashcards, quizzes, and transcripts. Also downloads subtitles, audio, or video from videos, playlists, or channels.
Ships in tube-scholar. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn a YouTube link (or a lecture on another video site, §7d) into something to learn from: by default a full study-guide page (§7); on request, plain subtitles, audio or video in a tidy folder, with nothing dumped in the home directory.
Paths. $SKILL below is this skill's own folder: the "Base directory for this skill" shown when it loads (~/.claude/skills/tube-scholar for a manual install, a plugin-cache path when installed as a plugin). Expand it before running a command.
| User wants | Mode |
|---|---|
| a single-video link with no other words, "اشرح", "شرح", "explain", "study guide", "flashcards", "quiz", "للمذاكرة" | study (default for one video; runs subs first, then §7) |
a playlist link (list=) with no other words, "البلاي ليست كلها", "كورس", "course" | course (study mode for every video, then one course page, §7c) |
| "ترجمة", "subtitles", "transcript", "captions" only, or a channel link with no other words | subs |
| "صوت", "audio", "mp3", "podcast" | audio |
| "فيديو", "download the video", "نزّل الفيديو" | video |
Language: default en. Arabic-speaking request for Arabic content, or "عربي" → ar. Both asked → en,ar.
Scope: a URL with list= is a playlist. yt-dlp downloads the whole list by default. If the user's words point at one video ("الفيديو ده"), add --no-playlist; otherwise take the whole list and say so in the reply.
Strip markdown brackets/angle brackets the user may have wrapped around the URL. Always quote the URL (& breaks the shell).
command -v yt-dlp >/dev/null || brew install yt-dlp
command -v ffmpeg >/dev/null || brew install ffmpeg # audio/video modes only
yt-dlp --flat-playlist --print "%(playlist_index)s %(title)s" "<URL>" 2>&1 | head -60
The listing gives the item count and the playlist/video title to name the folder. Playlists over ~50 items in video mode, or over ~25 in course mode (each video is a full guide; the page cap is 16 MB, ~0.55 MB per video): state the count and ask before starting.
~/Downloads/tube-scholar/<Folder>/ where <Folder> is the playlist title (or video title for a single video), shortened to a readable name with filesystem-hostile characters removed. Output template:
-o "%(playlist_index)s - %(title)s.%(ext)s"-o "%(title)s.%(ext)s"Common flags for every mode: --ignore-errors -P "<dir>" -o "<template>".
subs
yt-dlp --write-sub --write-auto-sub --sub-langs en --skip-download --ignore-errors \
-P "<dir>" -o "<template>" "<URL>"
--write-sub takes human captions when they exist; auto-subs fill the rest.
audio
yt-dlp -x --audio-format mp3 --audio-quality 0 --ignore-errors -P "<dir>" -o "<template>" "<URL>"
video
yt-dlp -f "bv*[height<=1080]+ba/b[height<=1080]" --merge-output-format mp4 \
--ignore-errors -P "<dir>" -o "<template>" "<URL>"
Run long jobs with a generous timeout (playlists take minutes). Filter the log to ERROR|Writing|Destination lines; never dump the full log.
Auto-subs are .vtt with timestamps and rolling duplicate lines — unreadable as-is. When the user wants to read, summarize, or feed them to Claude, convert:
python3 -I $SKILL/scripts/vtt2txt.py "<dir>"
Writes a .txt next to each .vtt: no timestamps, no tags, no repeated lines, wrapped into paragraphs. Offer this in the reply when not asked.
open "<dir>" as the first line.yt-dlp --list-subs "<URL>".Turns one video into a guide someone can learn from without watching: an academic explanation per topic, each linked to its minute in the video, plus a 5-minute summary, quick mode, scenario quiz and flashcards, in Arabic and English, as one artifact page. Read references/guide-format.md before writing anything; it is the file contract and the quality bar.
A playlist link is course mode (§7c): every video gets the full treatment below, and all of them land on one page. A link from another site (Udemy, Coursera, TED, Vimeo, ...) changes only where the subtitles and metadata come from (§7d).
<dir> below.--related-search "<speaker> <topic>", or list them with yt-dlp --flat-playlist --print "%(id)s|%(title)s" "ytsearch8:<query>" and pass the best three as --related, skipping re-uploads of this same course):
python3 -I $SKILL/scripts/fetch_meta.py "<URL>" "<dir>" --related ID1,ID2,ID3
.txt) and meta/video.json (description, chapters). Plan the sections around what the speaker actually teaches; the description's chapters are the skeleton when present.guide.ar.md, then guide.en.md as its translation (same sections, numbers and anchors), then cards.ar.txt / cards.en.txt and guide.json (with tags when the video has none, and a chapter_map entry for every description chapter, pointing at the heading where it starts). Put ▶️ [[ts: exact spoken words]] under every section and subsection heading.python3 -I $SKILL/scripts/resolve_ts.py "<dir>"
Any phrase it reports was not said verbatim: copy the exact words from the transcript and rerun. Never hand-write a timestamp.
5b. Independent fact-check (required): send references/fact-check-brief.md to a fresh background general-purpose agent (not the one that wrote the guide). It writes <dir>/audit.md. Fix every wrong and unsupported finding in both languages (and the cards), mark unclear ones as explainer's notes, then rerun step 5.markdown; the first line sets up a private venv once):
[ -x ~/.cache/tube-scholar/venv/bin/python ] || { python3 -m venv ~/.cache/tube-scholar/venv && ~/.cache/tube-scholar/venv/bin/pip -q install markdown==3.7; }
~/.cache/tube-scholar/venv/bin/python $SKILL/scripts/build_guide.py "<dir>"
It fails on any unfilled placeholder or a chapter_map heading with no ▶️ time. Then check: every section the reference guide has is present (header stats and hashtags, chapters, resources with related videos, socials), and node --check on the extracted <script>, no duplicate ids, every href="#…" has a target.python3 -I $SKILL/scripts/preview_guide.py "<dir>/guide.html"
Read the three PNGs in <dir>/preview/. Fix anything broken (overflow, clipped or overlapping text, wrong colours, an empty area) in the .md/guide.json or the skill's assets, rebuild, and preview once more. Never publish with the overflow check failing.
7b. Cheat sheet PDF: python3 -I $SKILL/scripts/cheatsheet.py "<dir>" writes cheatsheet.<lang>.pdf (summary, decision table, every calc/timeline/visual, glossary) next to the guide.<dir>/guide.html with the Artifact tool (quickstart intent: "other" first; on later rebuilds republish the same path). The page embeds its images, so it works from the link alone. Save the artifact link into guide.json as "artifact_url" (a playlist hub needs it).Rebuilds after edits: change the .md/.txt/guide.json, rerun steps 5–8. Never edit guide.html by hand; it is regenerated.
The quality bar per video is exactly §7: nothing is shortened because the page is long.
~/Downloads/tube-scholar/<Playlist>/, then §5. Make one folder per video, <Playlist>/NN - <short title>/, and move that video's .vtt/.txt into it. Skip removed/private items and list them in the report.guide.json, resolve timestamps, preview, cheat sheet). Fact-check (step 5b) runs one fresh background agent per video; start each as soon as that video's guide is written, so it overlaps with writing the next one. Do not publish the single-video pages.~/.cache/tube-scholar/venv/bin/python $SKILL/scripts/build_course.py "<playlist-dir>/course.html" "<playlist title>" "<video-dir-1>" "<video-dir-2>" ...
One page: a course header (totals and an index of every video), then each video's complete guide in order. One language switch flips every video; progress and flashcard reviews stay per video. It warns past 15 MB: split the list into two course pages (part 1, part 2) and say so.course.html as in steps 6–7 (node --check, duplicate ids, the preview script). Fix in the video's .md/guide.json, rerun the course build.course.html (Artifact, quickstart intent: "other" first) and report the link, the playlist folder, the per-video cheat sheets, skipped videos, and the explainer additions per video.Wanting separate pages instead ("صفحة لكل فيديو"): publish each guide.html, save its artifact_url, and link them with a hub:
~/.cache/tube-scholar/venv/bin/python $SKILL/scripts/build_hub.py "<playlist-dir>/hub.html" "<playlist title>" "<video-dir-1>" "<video-dir-2>" ...
Everything in §7 and §7c stays the same; only steps 1 and 2 (subtitles and metadata) change.
yt-dlp --list-extractors | grep -i <site>: TED, Vimeo, Khan Academy, Udemy, LinkedIn Learning, Pluralsight, ...): run §4 subs and fetch_meta.py as usual. Sites that need a login (Udemy, LinkedIn Learning, Pluralsight, most of Vimeo) take --cookies-from-browser chrome, on yt-dlp and on fetch_meta.py. Udemy names no instructor and labels Arabic captions en: pass --channel "<instructor>" --lang ar to fetch_meta.py, and rename the .vtt to .ar.vtt. A Udemy lecture link downloads the whole course with yt-dlp; add --playlist-items N (N from the --flat-playlist listing) for one lecture. Related videos are YouTube only: pass --related only when the speaker also has a YouTube channel.read_network_requests with pattern vtt|caption|subtitle gives the caption file's URL. Coursera also lists "Subtitles (English) WebVTT" under the lecture's Downloads.curl -sL "<caption URL>" -o "<dir>/<lecture title>.en.vtt". If that returns HTML or 403, fetch it inside the page with javascript_tool (fetch(url, {credentials: 'include'}).then(r => r.text())) and write the text to that file.python3 -I $SKILL/scripts/lecture_meta.py "<dir>" --url "<lecture URL>" --title "<lecture title>" \
--channel "<instructor or university>" --duration MM:SS [--chapters "0 Intro|95 Setup"] [--thumb IMAGE_URL]
get_page_text), make one folder per lecture, and follow §7c from step 2.▶️ links jump to the minute on YouTube and Vimeo. On other sites they open the lecture page and the minute shows as the link text.
HTTP Error 429 / "Sign in to confirm you're not a bot": retry with --cookies-from-browser chrome and --sleep-requests 1.brew upgrade yt-dlp before debugging anything else.en-ar style codes) exist but are low quality — prefer the original language track.assets/guide.css (opens in a new tab)assets/guide.js (opens in a new tab)assets/wrap.html (opens in a new tab)references/fact-check-brief.md (opens in a new tab)references/guide-format.md (opens in a new tab)scripts/build_course.py (opens in a new tab)scripts/build_guide.py (opens in a new tab)scripts/build_hub.py (opens in a new tab)scripts/cheatsheet.py (opens in a new tab)scripts/fetch_meta.py (opens in a new tab)scripts/lecture_meta.py (opens in a new tab)scripts/preview_guide.py (opens in a new tab)scripts/resolve_ts.py (opens in a new tab)scripts/vtt2txt.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
youtube, study-guide, flashcards, transcript, video-download, bilingual
npx claudepluginhub shalaby-vbs/tube-scholar --plugin tube-scholarOther plugins' skills for the same job