From cf3f3e44977f72c12d73b5807c4998993d236332 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Sun, 7 May 2023 13:06:11 +0200 Subject: [PATCH] BrowserSteps - BrowserSteps was not always following proxy information --- changedetectionio/blueprint/browser_steps/__init__.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/changedetectionio/blueprint/browser_steps/__init__.py b/changedetectionio/blueprint/browser_steps/__init__.py index 381b2e59..37f18a81 100644 --- a/changedetectionio/blueprint/browser_steps/__init__.py +++ b/changedetectionio/blueprint/browser_steps/__init__.py @@ -169,7 +169,18 @@ def construct_blueprint(datastore: ChangeDetectionStore): if proxy_id: proxy_url = datastore.proxy_list.get(proxy_id).get('url') if proxy_url: + + # Playwright needs separate username and password values + from urllib.parse import urlparse + parsed = urlparse(proxy_url) proxy = {'server': proxy_url} + + if parsed.username: + proxy['username'] = parsed.username + + if parsed.password: + proxy['password'] = parsed.password + print("Browser Steps: UUID {} Using proxy {}".format(uuid, proxy_url)) # Begin the new "Playwright Context" that re-uses the playwright interface