{"id":30700918,"url":"https://github.com/wryan14/youtube-whisper","last_synced_at":"2026-05-10T07:53:54.479Z","repository":{"id":312425036,"uuid":"1047451521","full_name":"wryan14/youtube-whisper","owner":"wryan14","description":"Transcribe audio files and YouTube videos to text with timestamps using OpenAI's Whisper API.","archived":false,"fork":false,"pushed_at":"2025-08-30T14:02:12.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-30T15:20:55.603Z","etag":null,"topics":["flask","openai-whisper","python","speech-to-text","subtitles","transcription","whisper","youtube-downloader"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wryan14.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-30T12:59:18.000Z","updated_at":"2025-08-30T14:02:16.000Z","dependencies_parsed_at":"2025-08-30T15:20:56.643Z","dependency_job_id":"e7e04ccd-e3af-4695-b77c-8c5329bacd44","html_url":"https://github.com/wryan14/youtube-whisper","commit_stats":null,"previous_names":["wryan14/youtube-whisper"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/wryan14/youtube-whisper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wryan14%2Fyoutube-whisper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wryan14%2Fyoutube-whisper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wryan14%2Fyoutube-whisper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wryan14%2Fyoutube-whisper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wryan14","download_url":"https://codeload.github.com/wryan14/youtube-whisper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wryan14%2Fyoutube-whisper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002969,"owners_count":26083489,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flask","openai-whisper","python","speech-to-text","subtitles","transcription","whisper","youtube-downloader"],"created_at":"2025-09-02T13:01:10.481Z","updated_at":"2025-10-10T06:35:40.617Z","avatar_url":"https://github.com/wryan14.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# YouTube Whisper Transcription\n\nTranscribe audio files and YouTube videos using OpenAI's Whisper API with automatic subtitle generation.\n\n## What This Does\n\nThis application transcribes any audio file or YouTube video into text with timestamps. Upload an MP3, WAV, or other audio file (or provide a YouTube URL) and receive back a full transcript, plain text, and subtitle files. The system handles files up to 25MB automatically by splitting them into chunks for processing.\n\n## Prerequisites\n\nBefore you begin, you'll need:\n\n1. **Python 3.8 or higher** - Check with `python --version`\n2. **FFmpeg** - Required for audio processing\n3. **OpenAI API Key** - Required for transcription\n\n## Quick Setup (Recommended)\n\nUse the provided setup scripts for automatic installation:\n\n### Windows\n```cmd\nsetup.bat\n```\n\n### Mac/Linux\n```bash\nchmod +x setup.sh\n./setup.sh\n```\n\nThese scripts will:\n- Check for Python and FFmpeg\n- Create a virtual environment\n- Install all dependencies\n- Help configure your OpenAI API key\n- Create necessary directories\n- Generate a run script for easy launching\n\nAfter setup, run the application with:\n- **Windows**: `run.bat`\n- **Mac/Linux**: `./run.sh`\n\n## Manual Installation\n\nIf you prefer to set up manually or the scripts don't work for your system:\n\n### Step 1: Clone or Download\n\n```bash\ngit clone https://github.com/yourusername/youtube-whisper.git\ncd youtube-whisper\n```\n\nOr download and extract the ZIP file.\n\n### Step 2: Install Python Dependencies\n\nFirst, create a virtual environment to keep dependencies isolated:\n\n```bash\n# Create virtual environment\npython -m venv venv\n\n# Activate it\n# On Windows:\nvenv\\Scripts\\activate\n# On Mac/Linux:\nsource venv/bin/activate\n```\n\nThen install the required packages:\n\n```bash\npip install -r requirements.txt\n```\n\nOr install manually:\n```bash\npip install flask openai yt-dlp pydub\n```\n\n### Step 3: Install FFmpeg\n\nFFmpeg is required for audio processing. \n\n**Check if you have it:**\n```bash\nffmpeg -version\n```\n\n**If not installed:**\n\n**Windows:**\n1. Download from [ffmpeg.org ↗](https://ffmpeg.org/download.html)\n2. Extract the ZIP to `C:\\ffmpeg`\n3. Add `C:\\ffmpeg\\bin` to your system PATH:\n   - Right-click \"This PC\" → Properties → Advanced System Settings\n   - Click \"Environment Variables\"\n   - Under \"System Variables\", find \"Path\", click Edit\n   - Add `C:\\ffmpeg\\bin`\n   - Click OK and restart your terminal\n   - Detailed guide: [FFmpeg Windows Installation ↗](https://www.wikihow.com/Install-FFmpeg-on-Windows)\n\n**Mac:**\n```bash\n# Using Homebrew (install from brew.sh first)\nbrew install ffmpeg\n```\n\n**Linux (Ubuntu/Debian):**\n```bash\nsudo apt update\nsudo apt install ffmpeg\n```\n\nFor other systems, see [FFmpeg Download Page ↗](https://ffmpeg.org/download.html)\n\n### Step 4: Set Up OpenAI API Key\n\nYou need an API key from OpenAI to use the Whisper transcription service.\n\n**Get your API key:**\n1. Go to [OpenAI API Keys ↗](https://platform.openai.com/api-keys)\n2. Sign in or create an account (requires payment method)\n3. Click \"Create new secret key\"\n4. Copy the key that starts with `sk-`\n5. Save it somewhere safe - you won't see it again\n6. See [OpenAI API Quickstart ↗](https://platform.openai.com/docs/quickstart) for detailed setup\n\n**Set the API key in your environment:**\n\n**Windows (Command Prompt):**\n```cmd\nset OPENAI_API_KEY=sk-your-key-here\n```\n\n**Windows (PowerShell):**\n```powershell\n$env:OPENAI_API_KEY=\"sk-your-key-here\"\n```\n\n**Mac/Linux:**\n```bash\nexport OPENAI_API_KEY=\"sk-your-key-here\"\n```\n\n**To make it permanent:**\n\n- **Windows**: Add it to your system environment variables\n- **Mac/Linux**: Add the export line to `~/.bashrc` or `~/.zshrc`\n\n**Verify it's set:**\n```bash\n# Mac/Linux:\necho $OPENAI_API_KEY\n# Windows:\necho %OPENAI_API_KEY%\n```\n\n### Step 5: Create Data Directories\n\nThe application needs directories to store files:\n\n```bash\nmkdir -p data/audio data/transcripts data/subtitles\n```\n\nOn Windows:\n```cmd\nmkdir data\\audio\nmkdir data\\transcripts\nmkdir data\\subtitles\n```\n\n## Running the Application\n\n1. Make sure your virtual environment is activated:\n   ```bash\n   # Windows:\n   venv\\Scripts\\activate\n   # Mac/Linux:\n   source venv/bin/activate\n   ```\n\n2. Start the application:\n   ```bash\n   python app.py\n   ```\n\n3. Open your browser to:\n   ```\n   http://localhost:5000\n   ```\n\n4. Use the interface:\n   - Select \"Audio File\" or \"YouTube URL\" from the dropdown\n   - For audio files: Upload any audio file up to 25MB\n   - For YouTube: Paste the video URL\n   - Select the language\n   - Click \"Process\"\n   - Download your results (JSON, TXT, or SRT)\n\n## Using with Private YouTube Videos\n\nFor age-restricted, private, or member-only YouTube videos, you need to provide your browser cookies.\n\n### How to Get YouTube Cookies\n\n1. **Install a browser extension for cookie export:**\n   \n   **Recommended (exports directly in Netscape format):**\n   - Chrome/Edge: [Get cookies.txt LOCALLY ↗](https://chrome.google.com/webstore/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc) - Open source, safe alternative\n   - Firefox: [cookies.txt ↗](https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/)\n   \n   **Alternative options:**\n   - [Cookie-Editor ↗](https://chrome.google.com/webstore/detail/cookie-editor/hlkenndednhfkekhgcdicdfddnkalmdm) - Works on Chrome, Firefox, Edge (select Netscape export format)\n   - [EditThisCookie ↗](https://chrome.google.com/webstore/detail/editthiscookie/fngmhnnpilhplaeedifhccceomclgfbg) - Exports in JSON format (requires conversion)\n\n2. **Export your YouTube cookies:**\n   - Go to YouTube.com and sign in to your account\n   - Navigate to the private video you want to download\n   - Click the cookie extension icon in your browser\n   - For \"Get cookies.txt LOCALLY\": Click the download button\n   - For \"Cookie-Editor\": Click Export → Select \"Netscape\" format\n   - For \"EditThisCookie\": Click Export (you'll get JSON format - see note below)\n   - Copy all the text that appears\n\n3. **Use the cookies in the application:**\n   - Select \"YouTube URL\" as input type\n   - Paste your YouTube URL\n   - Paste the entire cookie text into the \"Cookies\" field\n   - Process as normal\n\n**Note about cookie formats:**\n- yt-dlp requires Netscape format (starts with `# Netscape HTTP Cookie File`)\n- If your extension exports JSON format, you'll need to convert it or use a different extension\n- \"Get cookies.txt LOCALLY\" is recommended as it exports directly in the correct format\n\n**Important notes about cookies:**\n- Cookies contain your login session - keep them private\n- They expire when you log out of YouTube\n- If videos stop working, export fresh cookies\n- Never share your cookies file with others\n- Cookie format requirements: See [yt-dlp cookie documentation ↗](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp)\n  - Must be in Netscape format (first line: `# Netscape HTTP Cookie File`)\n  - Some extensions export JSON format which needs conversion\n\n## How It Works\n\n```mermaid\nflowchart TD\n    A[Input Audio/URL] --\u003e B{Source Type}\n    B --\u003e|Audio File| C[Upload File]\n    B --\u003e|YouTube URL| D[Download Audio]\n    C --\u003e E{File Size Check}\n    D --\u003e E\n    E --\u003e|Under 25MB| F[Send to Whisper API]\n    E --\u003e|Over 25MB| G[Split into Chunks]\n    G --\u003e H[Transcribe Each Chunk]\n    H --\u003e I[Merge Transcripts]\n    F --\u003e J[Generate Outputs]\n    I --\u003e J\n    J --\u003e K[JSON + TXT + SRT Files]\n```\n\n**The process:**\n1. Audio is extracted from YouTube or uploaded directly\n2. Large files are automatically split into 10-minute chunks\n3. Each chunk is transcribed using OpenAI's Whisper API\n4. Timestamps are preserved and adjusted when merging\n5. Three output formats are generated with full timestamp data\n\n## API Costs\n\nOpenAI charges for Whisper API usage:\n- **Current pricing**: See [OpenAI API Pricing ↗](https://openai.com/api/pricing/) (Audio models section)\n- At time of writing: $0.006 per minute of audio\n- Example: A 1-hour video costs ~$0.36, a 10-minute video costs ~$0.06\n- You can set spending limits in your [OpenAI account dashboard ↗](https://platform.openai.com/account/limits)\n\n## Output Files\n\nThe application generates three file types:\n\n- **JSON** - Complete transcript with timestamp data for each segment\n- **TXT** - Plain text transcript without timestamps  \n- **SRT** - Subtitle file compatible with video editors and players ([SRT format spec ↗](https://en.wikipedia.org/wiki/SubRip))\n\nFiles are saved in:\n```\ndata/\n├── transcripts/   # JSON and TXT files\n└── subtitles/     # SRT files\n```\n\n## Troubleshooting\n\n### \"OPENAI_API_KEY environment variable not set\"\n- Make sure you've set the API key in your environment\n- Check it's set: `echo $OPENAI_API_KEY` (Mac/Linux) or `echo %OPENAI_API_KEY%` (Windows)\n- Make sure you activated the virtual environment\n\n### \"Failed to download audio\"\n- Check your internet connection\n- For private videos, make sure your cookies are fresh\n- Try with a public YouTube video to test\n\n### \"No module named 'flask'\" or similar\n- Make sure you activated the virtual environment\n- Install dependencies: `pip install -r requirements.txt`\n\n### \"FFmpeg not found\"\n- Install FFmpeg (see Step 3 above)\n- Restart your terminal after installation\n- Check it's in PATH: `ffmpeg -version`\n\n### Application won't start\n- Check Python version: `python --version` (needs 3.8+)\n- Make sure port 5000 is not in use\n- Try a different port: `python app.py --port 5001`\n\n### Large files taking too long\n- Files over 25MB are split into chunks\n- Each 10-minute chunk takes 30-60 seconds typically\n- Check the processing log in the browser for progress\n\n## File Structure\n\n```\nyoutube-whisper/\n├── app.py              # Main application\n├── requirements.txt    # Python dependencies\n├── README.md          # This file\n├── .gitignore         # Git ignore rules\n└── data/              # Generated files\n    ├── audio/         # Temporary audio files\n    ├── transcripts/   # JSON and TXT outputs\n    └── subtitles/     # SRT subtitle files\n```\n\n## Privacy \u0026 Security\n\n- Your audio files are processed locally and sent only to OpenAI's API\n- Temporary audio files are deleted after processing (unless KEEP_AUDIO_FILES is set)\n- YouTube cookies contain your login session - never share them\n- Your OpenAI API key is never stored by the application\n\n## Additional Resources\n\n- [OpenAI Whisper API Documentation ↗](https://platform.openai.com/docs/guides/speech-to-text)\n- [yt-dlp Documentation ↗](https://github.com/yt-dlp/yt-dlp#readme)\n- [yt-dlp Cookie FAQ ↗](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp)\n- [FFmpeg Documentation ↗](https://ffmpeg.org/documentation.html)\n- [Netscape Cookie File Format ↗](http://fileformats.archiveteam.org/wiki/Netscape_cookies.txt)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwryan14%2Fyoutube-whisper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwryan14%2Fyoutube-whisper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwryan14%2Fyoutube-whisper/lists"}