Spaces:
Sleeping
Sleeping
metadata
title: TutorialMaker
emoji: π»
colorFrom: indigo
colorTo: purple
sdk: gradio
sdk_version: 6.19.0
python_version: '3.13'
app_file: app.py
pinned: false
license: mit
short_description: Make Tutorials from YouTube Videos
YouTube β Tutorial Post Generator
Give a topic, your Hugging Face token, and a YouTube Data API key, and this
Space builds a downloadable .docx tutorial (text + captioned screenshots) from the
single best YouTube video on that topic. No video download β acquisition is API-based.
Pipeline
- Search β top 5 videos via the
adarshajay/youtube-searchSpace. - Sentiment rank β fetch each video's comments via the YouTube Data API v3 and
score them with the BERT classifier
OmarMedhat7/youtube-sentiment-analysis-model; the highest positive share wins. - Transcript β fetched with
youtube-transcript-api(already timestamped; no download, no Whisper). - Tutorial text β
deepseek-ai/DeepSeek-V3(HF Inference Providers, billed to your token) turns the transcript into an answer-engine-optimized post: answer-first paragraph, H2 steps, FAQ, meta description, URL slug, last-updated/source citation. Optional primary/secondary keyword placement. - Screenshots β real frames at the right moments without downloading the video:
yt-dlpresolves a direct stream URL (metadata only), thenffmpeg -ss T -frames:v 1grabs one frame per timestamp (sharpest of 3 candidates). Timestamps come from a weighted blend of the LLM's suggestion and the transcript's actual timing. - Captions β a vision model (default
Qwen/Qwen2.5-VL-72B-Instruct, billed to your token) captions each screenshot. - Assemble the
.docxfor download.
Keys & setup
- Hugging Face token β for the LLM + vision-model calls, billed to your account. Create a fine-grained token with "Make calls to Inference Providers" at https://huggingface.co/settings/tokens.
- YouTube Data API key β for fetching comments. Create one in the
Google Cloud Console and enable YouTube Data API
v3. Provide it in the UI, or set the
YOUTUBE_API_KEYSpace secret. (Without a key the Space skips sentiment and just uses the top search result.)
Notes on YouTube access
The transcript and the stream-URL resolution hit YouTube directly. From a datacenter IP (like a Space) these can occasionally be blocked:
- If transcript/stream resolution fails, set the optional
YT_PROXYsecret (a residential proxy) and/orYT_COOKIES(Netscape cookies.txt contents, raw or base64) β used only as a thin fallback. - If the stream URL can't be resolved, the Space still produces a text-only tutorial.
Local run
pip install -r requirements.txt # needs ffmpeg on PATH
python app.py