Turn a captioned YouTube video—or pasted transcript—into a summary, revision notes, and an active-recall quiz.
No API key required · Hosted-server fallback · 18-question quiz · Markdown export
Open the live app and click See a complete study pack instantly. The built-in demo uses an original sample transcript and local generation, so it makes no YouTube or model-provider request.
To run it locally instead:
git clone https://github.com/asadbek066/youtube-study-lab.git
cd youtube-study-lab
python -m venv .venvActivate the virtual environment
Linux/macOS
source .venv/bin/activateWindows PowerShell
.venv\Scripts\Activate.ps1Windows Command Prompt
.venv\Scripts\activate.batpython -m pip install --upgrade pip
python -m pip install -r requirements.txt
streamlit run app.pyOpen the local URL and use the same instant-demo flow.
| Output | What it is useful for |
|---|---|
| Structured summary | A fast overview, main ideas, examples, takeaways, and timestamp links when the source is a video |
| Study notes | Revision-friendly concepts, terminology, examples, and review prompts |
| 18-question quiz | Multiple-choice, short-answer, and application questions |
| Classification | Content type, confidence, and recommended summary/note styles |
| Transcript | The normalized caption text and source metadata |
| Markdown export | One portable file containing the complete study pack |
- Paste a YouTube URL or 11-character video ID.
- Choose preferred caption languages in the sidebar.
- Click Build study pack.
- Review the five result tabs or download the complete Markdown pack.
The video must expose a public manual or automatic caption track. The app tries youtube-transcript-api first and then falls back to caption tracks discovered through yt-dlp.
If YouTube blocks transcript requests from your machine or hosting provider, open YouTube blocked? Paste a transcript instead, add an optional title, and paste transcript text. The same study-pack engine runs without a YouTube request, and the app does not invent timestamps for text-only sources.
YouTube sources pass through language-aware transcript retrieval; pasted text goes directly to normalization. Long transcripts are split into bounded chunks. Each chunk is processed independently, then the results are merged and deduplicated into one study pack. Video sources retain timestamp links; pasted text does not receive fabricated timestamps.
The default mode works without a model API key.
| Mode | Configuration | Notes |
|---|---|---|
| Local heuristic | No setup required | Deterministic, private after transcript retrieval, and ideal for trying the app |
| OpenAI | LLM_PROVIDER=openai |
Uses an OpenAI model configured through .env |
| Azure OpenAI | LLM_PROVIDER=azure_openai |
Uses your Azure endpoint and deployment |
| Gemini | LLM_PROVIDER=gemini |
Uses a Google Gemini model configured through .env |
To configure an API provider:
cp .env.example .envOn Windows PowerShell, use:
Copy-Item .env.example .envThen edit .env and set only the provider variables you need. API keys are loaded from the environment and are never entered in the Streamlit interface.
Privacy note: In local heuristic mode, transcript processing stays in the app after retrieval. When an API provider is enabled, transcript chunks are sent to that provider under its terms and privacy policy.
Useful settings from .env.example include:
LLM_PROVIDER:heuristic,openai,azure_openai, orgemini- Provider model/deployment and API credentials
SUMMARY_STYLEandSUMMARY_DETAIL- Output-token limits for the configured provider
The app validates numeric bounds and automatically falls back to local generation when a configured provider is unavailable.
Install the dependencies, then run:
python -m pip install -r requirements-dev.txt
python -m ruff check app.py youtube_study_tool tests
python -m ruff format --check app.py youtube_study_tool tests
python -m pytest tests -q
python -m compileall -q app.py youtube_study_tool testsThe GitHub Actions workflow runs lint, formatting, and the test suite on Python 3.11 and 3.12 for pushes and pull requests.
- Videos without public captions cannot be fetched automatically; users can still paste transcript text.
- YouTube may throttle or block transcript requests from some hosted environments, which is why the app includes the pasted-transcript fallback.
- Local heuristic generation prioritizes reliability and zero setup over model-level prose quality.
- Inputs that would require more than 8 provider chunks use the bounded local fallback instead of multiplying paid generation calls.
- API-provider generation is capped at 10 calls per pack and three paid submissions per Streamlit session. This is a safety ceiling, not an account-wide rate limiter or spend guarantee.
- Provider output passes format, source-vocabulary, and citation-link checks; those checks reduce obvious fabrication but are not an independent factual verification system.
Bug reports, focused feature proposals, documentation improvements, and tested fixes are welcome. Read CONTRIBUTING.md before opening a pull request.
If this tool makes video learning easier for you, consider starring the repository. Follow @asadbek066 for more practical AI and developer tools.

