Skip to content

Latest commit

 

History

History
107 lines (77 loc) · 3.04 KB

File metadata and controls

107 lines (77 loc) · 3.04 KB

Changelog

Version 2.0 - Timeout Fix & Reliability Improvements

🔧 Fixes

  • Fixed timeout errors - Increased default timeout from 30s to 60s
  • Better error handling - Now shows clear messages when retrying
  • Improved reliability - Individual subtitle processing instead of batching

✨ New Features

  1. Automatic Retry with Exponential Backoff

    • Retries failed requests up to 3 times (configurable)
    • Waits progressively longer between retries (1s, 2s, 4s)
    • Shows retry progress in terminal
  2. Configurable Timeout

    • New --timeout flag (default: 60 seconds)
    • Can increase to 120+ seconds for slow connections
    • Example: --timeout 120
  3. Request Delay

    • New --delay flag (default: 1.0 seconds)
    • Prevents rate limiting by spacing requests
    • Example: --delay 2.0
  4. Max Retries

    • New --max-retries flag (default: 3)
    • Control how many times to retry failed requests
    • Example: --max-retries 5
  5. Better Progress Indicators

    • Shows "✅ Translated X/Y subtitles..." every 10 subtitles
    • Shows "⏱️ Timeout, retrying..." when needed
    • Shows "❌ Failed" if all retries exhausted

🚀 Performance Changes

  • Removed batching - Processes one subtitle at a time for better reliability
  • Added delays - 1 second between requests (prevents timeouts)
  • Longer timeout - 60 seconds per request (was 30s)

⚙️ New Command-Line Options

--timeout SECONDS     # Request timeout (default: 60)
--max-retries NUM     # Maximum retries (default: 3)
--delay SECONDS       # Delay between requests (default: 1.0)

📝 Usage Examples

For reliability (recommended):

python translate_srt.py input.srt -t es --timeout 90 --delay 2.0

For speed (may have more failures):

python translate_srt.py input.srt -t es --delay 0.5

Maximum reliability:

python translate_srt.py input.srt -t es --timeout 120 --delay 3.0 --max-retries 5

🗑️ Removed Features

  • Batch processing - Removed --batch-size flag
    • Batching was causing timeouts and translation errors
    • Individual processing is more reliable

📚 New Documentation

  • TROUBLESHOOTING.md - Comprehensive troubleshooting guide
  • QUICK_START.md - Fast reference for common commands
  • Updated README.md - Added timeout handling section

⏱️ Time Estimates

For 2,245 subtitles:

  • Old version: 15-30 minutes (but frequent failures)
  • New version (default): 40-60 minutes (reliable)
  • New version (fast): 20-30 minutes with --delay 0.5
  • New version (safe): 75-90 minutes with --delay 2.0

🐛 Bug Fixes

  • Fixed timeout errors by increasing default timeout
  • Fixed batch translation splitting issues
  • Fixed JSON response parsing for different API formats
  • Added missing import for time module

📦 Dependencies

No new dependencies! Still just:

  • requests >= 2.31.0

Version 1.0 - Initial Release

  • Basic SRT parsing and translation
  • Pollinations AI integration
  • Batch processing
  • Multi-language support