summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/MyShell.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2023-11-17 04:50:37 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2023-11-17 04:50:37 +0100
commit2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43 (patch)
tree5ed9c277ecceb2b90aabb32dd886a7eb704de101 /g4f/Provider/MyShell.py
parentAdd Poe Provider, Update AItianhuSpace Porvider (diff)
downloadgpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.gz
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.bz2
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.lz
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.xz
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.tar.zst
gpt4free-2ebbcdf0b81670e2b987e4d44f1efee8f68b3b43.zip
Diffstat (limited to 'g4f/Provider/MyShell.py')
-rw-r--r--g4f/Provider/MyShell.py16
1 files changed, 4 insertions, 12 deletions
diff --git a/g4f/Provider/MyShell.py b/g4f/Provider/MyShell.py
index 0efeb0e8..5580ff6e 100644
--- a/g4f/Provider/MyShell.py
+++ b/g4f/Provider/MyShell.py
@@ -21,16 +21,10 @@ class MyShell(BaseProvider):
proxy: str = None,
timeout: int = 120,
browser: WebDriver = None,
- hidden_display: bool = True,
+ headless: bool = True,
**kwargs
) -> CreateResult:
- if browser:
- driver = browser
- else:
- if hidden_display:
- driver, display = get_browser("", True, proxy)
- else:
- driver = get_browser("", False, proxy)
+ driver = browser if browser else get_browser("", headless, proxy)
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
@@ -87,9 +81,7 @@ return content;
elif chunk != "":
break
finally:
- driver.close()
if not browser:
+ driver.close()
time.sleep(0.1)
- driver.quit()
- if hidden_display:
- display.stop() \ No newline at end of file
+ driver.quit() \ No newline at end of file