Update MyShell.py

pull/1260/head
H Lohaus 11 months ago committed by GitHub
parent 29df5a21a8
commit 56db205111
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -24,13 +24,13 @@ class MyShell(BaseProvider):
hidden_display: bool = True, hidden_display: bool = True,
**kwargs **kwargs
) -> CreateResult: ) -> CreateResult:
if not browser: if browser:
driver = browser
else:
if hidden_display: if hidden_display:
driver, display = get_browser("", True, proxy) driver, display = get_browser("", True, proxy)
else: else:
display = get_browser("", False, proxy) driver = get_browser("", False, proxy)
else:
driver = browser
from selenium.webdriver.common.by import By from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
@ -66,7 +66,7 @@ window.reader = response.body.getReader();
script = """ script = """
chunk = await window.reader.read(); chunk = await window.reader.read();
if (chunk['done']) return null; if (chunk['done']) return null;
text = await (new Response(chunk['value']).text()); text = (new TextDecoder ()).decode(chunk['value']);
content = ''; content = '';
text.split('\\n').forEach((line, index) => { text.split('\\n').forEach((line, index) => {
if (line.startsWith('data: ')) { if (line.startsWith('data: ')) {

Loading…
Cancel
Save