fix unbound local variable python error
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
name = edge-tts
|
name = edge-tts
|
||||||
version = 4.0.7
|
version = 4.0.8
|
||||||
author = rany
|
author = rany
|
||||||
author_email = ranygh@riseup.net
|
author_email = ranygh@riseup.net
|
||||||
description = Microsoft Edge's TTS
|
description = Microsoft Edge's TTS
|
||||||
|
|||||||
@@ -261,6 +261,12 @@ class Communicate: # pylint: disable=too-few-public-methods
|
|||||||
if isinstance(messages, str):
|
if isinstance(messages, str):
|
||||||
messages = [messages]
|
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 aiohttp.ClientSession(trust_env=True) as session:
|
||||||
async with session.ws_connect(
|
async with session.ws_connect(
|
||||||
f"{WSS_URL}&ConnectionId={connect_id()}",
|
f"{WSS_URL}&ConnectionId={connect_id()}",
|
||||||
@@ -317,10 +323,6 @@ class Communicate: # pylint: disable=too-few-public-methods
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Begin listening for the response.
|
# Begin listening for the response.
|
||||||
download = False
|
|
||||||
current_subtitle = ""
|
|
||||||
first_offset = None
|
|
||||||
last_offset = None
|
|
||||||
async for received in websocket:
|
async for received in websocket:
|
||||||
if received.type in (
|
if received.type in (
|
||||||
aiohttp.WSMsgType.CLOSED,
|
aiohttp.WSMsgType.CLOSED,
|
||||||
|
|||||||
Reference in New Issue
Block a user