WhisperLive icon indicating copy to clipboard operation
WhisperLive copied to clipboard

Add support in WSS

Open Amitabitbul opened this issue 10 months ago • 5 comments

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-Agent header 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_segments method by removing the check for the completed flag. (whisper_live/client.py, whisper_live/client.pyL115-R121)

Transcript Writing:

  • Modified the write_srt_file method to always append the last_segment to the transcript if it exists, regardless of its content. (whisper_live/client.py, whisper_live/client.pyL262-R264)

Code Cleanup:

  • Removed unused parameters max_clients and max_connection_time from the on_open method and the __init__ method of the Client class. (whisper_live/client.py, [1] [2]

Amitabitbul avatar Dec 21 '24 21:12 Amitabitbul