A Stremio add-on that automatically translates subtitles from OpenSubtitles into your desired language using various translation providers.
- Fetches subtitles from OpenSubtitlesV3
- Supports multiple translation providers:
- Google Translate
- Free API
- Web Scraping Method
- DeepL API
- ChatGPT
- Google Gemini
- DeepGram
- RapidAPI Services
- Microsoft Translator
- MyMemory
- LingVanex
- Google Translate
- Configurable target language
- Queue system for handling translation requests
- Caches translated subtitles for better performance
- Automatic provider fallback
- Rate limiting protection
- Provider rotation for optimal performance
The add-on follows this workflow:
- Receives subtitle request from Stremio
- Checks if translated subtitle already exists in database
- If not found, fetches subtitle from OpenSubtitles
- Queues the subtitle for translation
- Returns a placeholder message while translation is processing
- Saves translated subtitle once complete
The add-on can be configured through Stremio with these options:
- Provider: Choose between Google Translate (free), DeepL, or ChatGPT
- API Key: Required for DeepL integration
- Target Language: Select your desired translation language
- Built with Node.js
- Uses
stremio-addon-sdk
for Stremio integration - Implements queue system using
better-queue
- Stores subtitles in local filesystem
- Environment variables for configuration
-
Web Installation (Recommended)
- Open Stremio
- Go to: in construction
- Click "Install Add-on"
- Select your preferred translation settings
- Click "Install"
- The add-on will be automatically configured in your Stremio
-
Manual Installation
- Open Stremio
- Go to Add-ons
- Click the "Community Add-ons" tab
- Paste this URL: in construction
- Click "Install"
-
Self-Hosting
# Clone the repository git clone https://github.com/HimAndRobot/stremio-translate-subtitle-by-geanpn.git cd stremio-auto-translate # Install dependencies npm install # Create .env file with required settings PORT=3000 ADDRESS=0.0.0.0 BASE_URL=http://localhost:3000 # Start the add-on npm start
Then add
http://localhost:3000/manifest.json
to Stremio
The add-on will be available at http://localhost:3000
PORT
: Server port (default: 3000)ADDRESS
: Server address (default: 0.0.0.0)BASE_URL
: Base URL for subtitle files
The add-on uses a queue system to handle translation requests efficiently:
- Implements
better-queue
for managing translation tasks - Concurrent processing of subtitles
- Automatic retries on failure
- Progress tracking and status updates
- Subtitles are stored in the local filesystem
- Organized by provider, language, and media ID
- Cached translations for improved performance
- Subtitle files are parsed and split into chunks
- Each chunk is translated using the selected provider
- Translated chunks are reassembled maintaining timing
- Final subtitle file is saved in SRT format
Bug reports and pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
For bug reports: geanpn@gmail.com For donations:
This project is based on Auto-Subtitle-Translate-by-Sonsuz-Anime by @sonsuzanime. The original project was enhanced with:
- Google Translate (Free)
- API Integration
- Web Scraping Method
- DeepL API
- ChatGPT
- Google Gemini
- DeepGram
- RapidAPI Providers
- Microsoft Translator
- MyMemory
- LingVanex
- Code optimizations
- Queue system for handling multiple translation requests
- Improved error handling
- Better caching system
- Provider fallback system
- Rate limiting protection
- Automatic provider rotation
- Chunk optimization for large subtitles
Special thanks to @sonsuzanime for the original implementation that made this project possible.