mirror of
https://github.com/rany2/edge-tts
synced 2024-11-22 01:45:02 +00:00
fix unbound local variable python error
This commit is contained in:
parent
871f1938e6
commit
7d03764943
@ -1,6 +1,6 @@
|
||||
[metadata]
|
||||
name = edge-tts
|
||||
version = 4.0.7
|
||||
version = 4.0.8
|
||||
author = rany
|
||||
author_email = ranygh@riseup.net
|
||||
description = Microsoft Edge's TTS
|
||||
|
@ -261,6 +261,12 @@ class Communicate: # pylint: disable=too-few-public-methods
|
||||
if isinstance(messages, str):
|
||||
messages = [messages]
|
||||
|
||||
|
||||
# Variables for the loop
|
||||
download = False
|
||||
current_subtitle = ""
|
||||
first_offset = None
|
||||
last_offset = None
|
||||
async with aiohttp.ClientSession(trust_env=True) as session:
|
||||
async with session.ws_connect(
|
||||
f"{WSS_URL}&ConnectionId={connect_id()}",
|
||||
@ -317,10 +323,6 @@ class Communicate: # pylint: disable=too-few-public-methods
|
||||
)
|
||||
|
||||
# Begin listening for the response.
|
||||
download = False
|
||||
current_subtitle = ""
|
||||
first_offset = None
|
||||
last_offset = None
|
||||
async for received in websocket:
|
||||
if received.type in (
|
||||
aiohttp.WSMsgType.CLOSED,
|
||||
|
Loading…
Reference in New Issue
Block a user