|
|
@ -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: ')) {
|
|
|
|