mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 16:44:13 +08:00
sakura
This commit is contained in:
parent
b03d00d30d
commit
b8a548af7d
@ -192,10 +192,11 @@ class TS(basetrans):
|
||||
if not output.headers["Content-Type"].startswith("text/event-stream"):
|
||||
raise Exception(output.text)
|
||||
for o in output.iter_lines():
|
||||
if o == b"data: [DONE]":
|
||||
o = o.decode("utf-8").strip()
|
||||
if o == "data: [DONE]":
|
||||
break
|
||||
try:
|
||||
res = o.decode("utf-8").strip()[6:] # .replace("data: ", "")
|
||||
res = o[6:]
|
||||
# print(res)
|
||||
if res == "":
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user