This script downloads audio files from a remote Linux server via SSH, converts them to WAV, generates English SRT subtitles using WhisperX, and uploads the subtitles back.
- Recursively finds and downloads audio (
aac,mp3,ogg,wav, etc.) from a server directory - Converts to
.wavif needed (usingffmpeg) - Runs WhisperX to generate
.srtsubtitles with fine granularity - Uploads generated subtitles back to the server via SFTP
- Python 3.7+
ffmpegin your PATH- WhisperX
- Python:
pip install paramiko tqdm
- Edit the script to set:
SERVER_IP,SERVER_PORT,USERNAME,PRIVATE_KEY_PATH
- Run:
Replace
python generate_subs_from_server.py /remote/path/to/search
/remote/path/to/searchwith the actual remote directory.
- Script uses your SSH private key (default:
~/.ssh/id_rsa) - Subtitles are generated per audio file and uploaded to the same directory on the server
- Temporary files are cleaned up automatically
Simple, fast, and automated subtitle workflow for your server audio files!