TubeToTweet is an AI-powered Streamlit app that converts public YouTube videos into:
- A concise, factual summary
- A viral-ready X (Twitter) post under 280 characters
- Extracts YouTube metadata (title, description, channel, duration, views)
- Generates a 300–500 word summary with Gemini
- Generates a viral X post with hook, emojis, hashtags, and CTA
- Supports custom Gemini API key input directly in the UI
- Supports model fallback via configurable
GEMINI_MODELS - Displays content metrics (word count, chars, reading time, engagement score)
- Includes one-click copy buttons for summary and X post
- Persists generated content in session history
- Exports summary and post as
.txtfiles
- Python 3.10+
- Gemini API key (
GOOGLE_API_KEY) or manual key entry in-app
- Clone the repository and open the folder.
- Create and activate a virtual environment.
- Install dependencies.
- Configure environment variables.
- Run Streamlit.
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
New-Item -Path .env -ItemType File -Force
streamlit run app.pypython -m venv venv
venv\Scripts\activate.bat
pip install -r requirements.txt
type nul > .env
streamlit run app.pyCreate a .env file in the project root and set:
GOOGLE_API_KEY=your_actual_api_key_here
# Optional: comma-separated fallback models
GEMINI_MODELS=models/gemini-2.5-flash-lite,models/gemini-2.5-flashIf
GOOGLE_API_KEYis not present in.env, you can paste your key directly into the app input field.
-
Start the app:
streamlit run app.py
-
Enter your Gemini API key (or use
.envkey). -
Paste a public YouTube URL.
-
Click Generate.
-
Review summary, edit X post, copy/export, and check history.
App demonstration video:
Contributions to TubeToTweet are highly encouraged! Whether it’s code improvements, bug fixes, or feature enhancements, feel free to contribute to the project repository.
TubeToTweet is licensed under the MIT License, granting you the freedom to use, modify, and distribute the code in accordance with the terms of the license.


