From a5fceb13276b050c97b09eed1629c62c4bc6e0f8 Mon Sep 17 00:00:00 2001 From: idealzhou1 <107456732+idealzhou1@users.noreply.github.com> Date: Mon, 25 Aug 2025 13:46:23 +0800 Subject: [PATCH] Update bingZDH.py --- bingZDH.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bingZDH.py b/bingZDH.py index f4a17a7..214bbe4 100644 --- a/bingZDH.py +++ b/bingZDH.py @@ -785,14 +785,21 @@ def create_chrome_options(): chrome_options.add_argument('--allow-running-insecure-content') chrome_options.add_argument('--disable-blink-features=AutomationControlled') + # 在GitHub Actions环境中添加额外选项 + if os.getenv('GITHUB_ACTIONS'): + chrome_options.add_argument('--disable-dev-shm-usage') + chrome_options.add_argument('--disable-software-rasterizer') + chrome_options.add_argument('--disable-background-timer-throttling') + chrome_options.add_argument('--disable-backgrounding-occluded-windows') + chrome_options.add_argument('--disable-renderer-backgrounding') + chrome_options.add_argument('--disable-features=TranslateUI') + chrome_options.add_argument('--disable-ipc-flooding-protection') + if HEADLESS: chrome_options.add_argument('--headless=new') chrome_options.add_argument('--disable-gpu') chrome_options.add_argument('--window-size=1920,1080') chrome_options.add_argument('--remote-debugging-port=9222') - chrome_options.add_argument('--disable-background-timer-throttling') - chrome_options.add_argument('--disable-backgrounding-occluded-windows') - chrome_options.add_argument('--disable-renderer-backgrounding') return chrome_options @@ -1066,4 +1073,4 @@ if __name__ == "__main__": print("python bingZDH.py --auto # 每天凌晨2点自动执行") else: # 默认执行一次 - main() \ No newline at end of file + main()