WhisperLive
WhisperLive copied to clipboard
Add support in WSS
This pull request includes several changes to the whisper_live/client.py file, focusing on improving the WebSocket connection handling, segment processing, and transcript writing. The most important changes are summarized below:
WebSocket Connection Handling:
- Added support for secure WebSocket connections (wss) when the port is 443. (
whisper_live/client.py, whisper_live/client.pyR73-R75) - Included a custom
User-Agentheader in the WebSocket connection. (whisper_live/client.py, whisper_live/client.pyR85)
Segment Processing:
- Simplified the logic for handling the last segment in the
process_segmentsmethod by removing the check for thecompletedflag. (whisper_live/client.py, whisper_live/client.pyL115-R121)
Transcript Writing:
- Modified the
write_srt_filemethod to always append thelast_segmentto the transcript if it exists, regardless of its content. (whisper_live/client.py, whisper_live/client.pyL262-R264)
Code Cleanup:
- Removed unused parameters
max_clientsandmax_connection_timefrom theon_openmethod and the__init__method of theClientclass. (whisper_live/client.py, [1] [2]