Spaces:
Running
Running
Upload 2 files
Browse files
app.py
CHANGED
|
@@ -14,9 +14,9 @@ async def lifespan(app: FastAPI):
|
|
| 14 |
if not os.path.exists("game_history.csv"):
|
| 15 |
open("game_history.csv", "w").close()
|
| 16 |
|
| 17 |
-
# Start the bot.py in background
|
| 18 |
-
bot_process = subprocess.Popen(["python", "run_bot.py"])
|
| 19 |
-
print("[SERVER] Bot started in background...")
|
| 20 |
|
| 21 |
yield
|
| 22 |
|
|
|
|
| 14 |
if not os.path.exists("game_history.csv"):
|
| 15 |
open("game_history.csv", "w").close()
|
| 16 |
|
| 17 |
+
# Start the bot.py in background with xvfb wrapper to simulate a real monitor display
|
| 18 |
+
bot_process = subprocess.Popen(["xvfb-run", "-a", "python", "run_bot.py"])
|
| 19 |
+
print("[SERVER] Bot started in background with Xvfb (Virtual Display)...")
|
| 20 |
|
| 21 |
yield
|
| 22 |
|
bot.py
CHANGED
|
@@ -28,7 +28,7 @@ class AviatorBot:
|
|
| 28 |
launch_args = ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process"]
|
| 29 |
|
| 30 |
self.browser = await self.playwright.chromium.launch(
|
| 31 |
-
headless=
|
| 32 |
args=["--disable-blink-features=AutomationControlled"]
|
| 33 |
)
|
| 34 |
|
|
|
|
| 28 |
launch_args = ["--disable-web-security", "--disable-features=IsolateOrigins,site-per-process"]
|
| 29 |
|
| 30 |
self.browser = await self.playwright.chromium.launch(
|
| 31 |
+
headless=False,
|
| 32 |
args=["--disable-blink-features=AutomationControlled"]
|
| 33 |
)
|
| 34 |
|