feat: Add OpenAI Whisper transcription and Gemini translation support#3
Open
danyuchn wants to merge 1 commit intoop7418:mainfrom
Open
feat: Add OpenAI Whisper transcription and Gemini translation support#3danyuchn wants to merge 1 commit intoop7418:mainfrom
danyuchn wants to merge 1 commit intoop7418:mainfrom
Conversation
## New Features - **Auto-transcription**: OpenAI Whisper API for videos without subtitles - Supports long audio (no token limits) - Cost: ~$0.006/minute - Tested on 73-minute video (2427 segments, 209 seconds) - **Gemini API integration**: 93% cost reduction vs Claude API - Gemini 2.5 Flash Lite for translation (batch size: 30) - Gemini 2.5 Flash for content generation - Cost: ~$0.45 vs ~$6.30 for 18 chapters - **YouTube HTTP 403 bypass**: iOS/Android client parameters - Documented in references/yt-dlp-guide.md ## New Scripts - scripts/transcribe_with_openai.py: Whisper API transcription - scripts/translate_with_gemini.py: Gemini batch translation - scripts/merge_bilingual_from_json.py: JSON to SRT conversion ## Updated Documentation - TECHNICAL_NOTES.md: Added sections 11-15 for new technical issues - FIXES_AND_IMPROVEMENTS.md: Added 2026-01-25 version with test results - README.md & README.zh-CN.md: Added API keys configuration - references/yt-dlp-guide.md: Added HTTP 403 solution - .env.example: Added OPENAI_API_KEY and GEMINI_API_KEY ## Test Results - 73-minute Chinese video (no subtitles) - 18 chapters processed - 100% success rate - Total cost: $0.74-0.89 - Processing time: 25-30 minutes ## Backward Compatibility - Original Claude API support retained - All new features are optional - No breaking changes Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Motivation
✨ New Features
1. Auto-transcription with OpenAI Whisper API
2. Gemini API integration for translation
3. YouTube HTTP 403 bypass
📊 Tested On
Cost Comparison (18 chapters)
🔧 Technical Details
New Scripts
scripts/transcribe_with_openai.py- Whisper API transcriptionscripts/translate_with_gemini.py- Gemini batch translation (30 items/batch)scripts/merge_bilingual_from_json.py- JSON to SRT format conversionUpdated Documentation
API Keys Required
📋 Breaking Changes
None - This PR only adds new optional features:
🔍 Key Implementation Details
Whisper Transcription
Gemini Translation
Anti-truncation Mechanism
max_output_tokens: Increased from 3000 → 8000🧪 Testing
💡 Future Improvements (Not in this PR)
Note: This PR represents real-world usage and optimization based on processing a complete 73-minute video with 18 chapters. All features have been tested and validated in production scenarios.