Error translating text: HTTPSConnectionPool(host='text.pollinations.ai', port=443): Read timed out. (read timeout=30)
The default timeout is now 60 seconds. If you still get timeouts, increase it:
python translate_srt.py input.srt -t es --timeout 120This gives each request 2 minutes to complete.
Add more delay between requests to give the API breathing room:
python translate_srt.py input.srt -t es --delay 2.0This waits 2 seconds between each subtitle translation.
Increase the number of retries:
python translate_srt.py input.srt -t es --max-retries 5For best reliability with free tier:
python translate_srt.py input.srt -t es --timeout 90 --delay 2.0 --max-retries 5The script now:
- ✅ 60-second timeout (was 30s)
- ✅ Automatic retries with exponential backoff
- ✅ Delays between requests (1 second default)
- ✅ Individual subtitle processing (no more batching)
- ✅ Better error messages with retry indicators
Getting too many requests or rate limit errors.
-
Increase delay:
python translate_srt.py input.srt -t es --delay 3.0
-
Get an API key for higher tier access:
- Visit Pollinations AI
- Sign up for free tier (higher limits)
- Use with:
--api-key YOUR_KEY
Connection errors, DNS failures, or network timeouts.
- Check internet connection
- Try a different network
- Check if API is accessible:
curl https://text.pollinations.ai/
Translating 2,245 subtitles individually with delays:
- Default: 1 second delay × 2,245 = ~37 minutes minimum
- Plus translation time: ~1-2 hours total
-
Reduce delay (may cause rate limiting):
python translate_srt.py input.srt -t es --delay 0.5
-
Get API key for higher tier (up to 50 concurrent requests):
python translate_srt.py input.srt -t es --api-key YOUR_KEY --delay 0.1
-
Try a different model (some might be faster):
python translate_srt.py input.srt -t es --model mistral
Translation is incorrect or doesn't make sense.
-
Specify source language explicitly:
python translate_srt.py input.srt -s en -t es
-
Try a different model:
python translate_srt.py input.srt -t es --model claude
Translation stopped midway and you want to continue.
- Open the partially translated SRT file
- Find the last translated entry number (e.g., entry #150)
- Edit the original script to skip already translated entries
Or:
- Delete the partial output file
- Re-run with better settings:
python translate_srt.py input.srt -t es --timeout 120 --delay 2.0
Getting empty translations or original text back.
- API might be down or rate-limited
- Request format might not match API expectations
- Model might not support the language
-
Check API status:
curl -X POST https://text.pollinations.ai/ \ -H "Content-Type: application/json" \ -d '{"messages":[{"role":"user","content":"Hello"}]}'
-
Try different model:
python translate_srt.py input.srt -t es --model openai
-
Check language support:
- Some models may not support all languages
- Try common languages first (Spanish, French, German)
python translate_srt.py "One.Battle.After.Another.2025.1080p.AMZN.WEB-DL.DDP5.1.H.264-KyoGo.srt" \
-t es \
-o "translated.srt" \
--timeout 120 \
--max-retries 5 \
--delay 2.0python translate_srt.py input.srt \
-t es \
--delay 3.0 \
--max-retries 3python translate_srt.py input.srt \
-t es \
--timeout 120 \
--delay 3.0 \
--max-retries 5python translate_srt.py input.srt \
-t es \
--api-key YOUR_KEY \
--timeout 60 \
--delay 0.5You'll see messages like:
✅ Translated 10/2245 subtitles...
⏱️ Timeout on attempt 1/3. Retrying in 1.0s...
✅ Translated 20/2245 subtitles...
- ✅ = Successful translation
- ⏱️ = Timeout, retrying
⚠️ = Error, retrying- ❌ = Failed after all retries (uses original text)
If none of these solutions work:
- Check the Pollinations AI status page
- Try again during off-peak hours
- Consider using an alternative translation API
- Open an issue with the error message and command you ran
For very large files, consider splitting them:
- Split your SRT into smaller files (500 subtitles each)
- Translate each file separately
- Combine the results
This makes it easier to resume if something fails.