diff --git a/changedetectionio/forms.py b/changedetectionio/forms.py index 7f33a686..c6afd2f4 100644 --- a/changedetectionio/forms.py +++ b/changedetectionio/forms.py @@ -740,7 +740,6 @@ class commonSettingsForm(Form): self.notification_title.extra_notification_tokens = kwargs.get('extra_notification_tokens', {}) self.notification_urls.extra_notification_tokens = kwargs.get('extra_notification_tokens', {}) - browser_profile = RadioField(_l('Browser / Fetch method'), choices=[]) # populated at runtime in edit.py notification_body = TextAreaField(_l('Notification Body'), default='{{ watch_url }} had a change.', validators=[validators.Optional(), ValidateJinja2Template()]) notification_format = SelectField(_l('Notification format'), choices=list(valid_notification_formats.items())) notification_title = StringField(_l('Notification Title'), default='ChangeDetection.io Notification - {{ watch_url }}', validators=[validators.Optional(), ValidateJinja2Template()]) @@ -777,6 +776,7 @@ class SingleBrowserStep(Form): class processor_text_json_diff_form(commonSettingsForm): + browser_profile = RadioField(_l('Browser / Fetch method'), choices=[]) # populated at runtime in edit.py url = fields.URLField('Web Page URL', validators=[validateURL()]) tags = StringTagUUID('Group Tag', [validators.Optional()], default='') diff --git a/changedetectionio/processors/base.py b/changedetectionio/processors/base.py index f0c97231..1b13918e 100644 --- a/changedetectionio/processors/base.py +++ b/changedetectionio/processors/base.py @@ -37,6 +37,8 @@ class difference_detection_processor(): # 2. Preserves Watch object with properties (.link, .is_pdf, etc.) - can't use dict() # 3. Safe now: Watch.__deepcopy__() shares datastore ref (no memory leak) but copies dict data self.watch = deepcopy(self.datastore.data['watching'].get(watch_uuid)) + if self.watch is None: + raise KeyError(f"Watch UUID {watch_uuid} not found in datastore (deleted before processing?)") # Generic fetcher that should be extended (requests, playwright etc) self.fetcher = Fetcher() diff --git a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py index cb333c44..2006c65d 100644 --- a/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py +++ b/changedetectionio/tests/custom_browser_url/test_custom_browser_url.py @@ -39,12 +39,12 @@ def do_test(client, live_server, make_test_use_extra_browser=False): test_url = "https://changedetection.io/ci-test.html?non-custom-default=true" # Set global default to webdriver (browser-based) + client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True) res = client.post( url_for("settings.settings_page"), data={ "application-empty_pages_are_a_change": "", "requests-time_between_check-minutes": 180, - "application-browser_profile": "browser_chromeplaywright", }, follow_redirects=True ) diff --git a/changedetectionio/tests/fetchers/test_content.py b/changedetectionio/tests/fetchers/test_content.py index ac03cba3..f7745443 100644 --- a/changedetectionio/tests/fetchers/test_content.py +++ b/changedetectionio/tests/fetchers/test_content.py @@ -12,12 +12,12 @@ def test_fetch_webdriver_content(client, live_server, measure_memory_usage, data # live_server_setup(live_server) # Setup on conftest per function ##################### + client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True) res = client.post( url_for("settings.settings_page"), data={ "application-empty_pages_are_a_change": "", "requests-time_between_check-minutes": 180, - 'application-browser_profile': "browser_chromeplaywright", 'application-ui-favicons_enabled': "y", }, follow_redirects=True diff --git a/changedetectionio/tests/proxy_list/test_noproxy.py b/changedetectionio/tests/proxy_list/test_noproxy.py index 713906e9..194cc46f 100644 --- a/changedetectionio/tests/proxy_list/test_noproxy.py +++ b/changedetectionio/tests/proxy_list/test_noproxy.py @@ -22,7 +22,6 @@ def test_noproxy_option(client, live_server, measure_memory_usage, datastore_pat data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": "direct_http_requests", "requests-extra_proxies-0-proxy_name": "custom-one-proxy", "requests-extra_proxies-0-proxy_url": "http://test:awesome@squid-one:3128", "requests-extra_proxies-1-proxy_name": "custom-two-proxy", diff --git a/changedetectionio/tests/proxy_list/test_proxy_noconnect.py b/changedetectionio/tests/proxy_list/test_proxy_noconnect.py index 185da1d2..111289ed 100644 --- a/changedetectionio/tests/proxy_list/test_proxy_noconnect.py +++ b/changedetectionio/tests/proxy_list/test_proxy_noconnect.py @@ -21,7 +21,6 @@ def test_proxy_noconnect_custom(client, live_server, measure_memory_usage, datas data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": 'browser_chromeplaywright' if os.getenv('PLAYWRIGHT_DRIVER_URL') or os.getenv("WEBDRIVER_URL") else 'direct_http_requests', "requests-extra_proxies-0-proxy_name": "custom-test-proxy", # test:awesome is set in tests/proxy_list/squid-passwords.txt "requests-extra_proxies-0-proxy_url": "http://127.0.0.1:3128", diff --git a/changedetectionio/tests/proxy_list/test_select_custom_proxy.py b/changedetectionio/tests/proxy_list/test_select_custom_proxy.py index 30266965..c3e84954 100644 --- a/changedetectionio/tests/proxy_list/test_select_custom_proxy.py +++ b/changedetectionio/tests/proxy_list/test_select_custom_proxy.py @@ -15,7 +15,6 @@ def test_select_custom(client, live_server, measure_memory_usage, datastore_path data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": 'browser_chromeplaywright' if os.getenv('PLAYWRIGHT_DRIVER_URL') else 'direct_http_requests', "requests-extra_proxies-0-proxy_name": "custom-test-proxy", # test:awesome is set in tests/proxy_list/squid-passwords.txt "requests-extra_proxies-0-proxy_url": "http://test:awesome@squid-custom:3128", @@ -59,7 +58,6 @@ def test_custom_proxy_validation(client, live_server, measure_memory_usage, data data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": 'direct_http_requests', "requests-extra_proxies-0-proxy_name": "custom-test-proxy", "requests-extra_proxies-0-proxy_url": "xxxxhtt/333??p://test:awesome@squid-custom:3128", }, @@ -75,7 +73,6 @@ def test_custom_proxy_validation(client, live_server, measure_memory_usage, data data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": 'direct_http_requests', "requests-extra_proxies-0-proxy_name": "custom-test-proxy", "requests-extra_proxies-0-proxy_url": "https://", }, diff --git a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py index 3dfe1bcb..8f7ca094 100644 --- a/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py +++ b/changedetectionio/tests/proxy_socks5/test_socks5_proxy.py @@ -29,7 +29,6 @@ def test_socks5(client, live_server, measure_memory_usage, datastore_path): data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-browser_profile": "direct_http_requests", # set in .github/workflows/test-only.yml "requests-extra_proxies-0-proxy_url": "socks5://proxy_user123:proxy_pass123@socks5proxy:1080", "requests-extra_proxies-0-proxy_name": "socks5proxy", diff --git a/changedetectionio/tests/restock/test_restock.py b/changedetectionio/tests/restock/test_restock.py index e7f60e17..a496ca69 100644 --- a/changedetectionio/tests/restock/test_restock.py +++ b/changedetectionio/tests/restock/test_restock.py @@ -61,14 +61,14 @@ def test_restock_detection(client, live_server, measure_memory_usage, datastore_ ##################### # Set this up for when we remove the notification from the watch, it should fallback with these details + client.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True) res = client.post( url_for("settings.settings_page"), data={"application-notification_urls": notification_url, "application-notification_title": "fallback-title "+default_notification_title, "application-notification_body": "fallback-body "+default_notification_body, "application-notification_format": default_notification_format, - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "browser_chromeplaywright"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) # Add our URL to the import page, because the docker container (playwright/selenium) wont be able to connect to our usual test url diff --git a/changedetectionio/tests/smtp/test_notification_smtp.py b/changedetectionio/tests/smtp/test_notification_smtp.py index 74788ade..bd7c5027 100644 --- a/changedetectionio/tests/smtp/test_notification_smtp.py +++ b/changedetectionio/tests/smtp/test_notification_smtp.py @@ -56,8 +56,7 @@ def test_check_notification_email_formats_default_HTML(client, live_server, meas "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": "some text\nfallback-body
" + default_notification_body, "application-notification_format": 'html', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data @@ -126,8 +125,7 @@ def test_check_notification_plaintext_format(client, live_server, measure_memory "application-notification_title": "fallback-title {{watch_title}} {{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }} " + default_notification_title, "application-notification_body": f"some text\n" + default_notification_body + f"\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'text', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -188,8 +186,7 @@ def test_check_notification_html_color_format(client, live_server, measure_memor "application-notification_title": "fallback-title {{watch_title}} - diff_added_lines_test : '{{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }}' " + default_notification_title, "application-notification_body": f"some text\n{default_notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'htmlcolor', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -273,8 +270,7 @@ def test_check_notification_markdown_format(client, live_server, measure_memory_ "application-notification_title": "fallback-title diff_added_lines_test : '{{ diff_added.splitlines()[0] if diff_added else 'diff added didnt split' }}' " + default_notification_title, "application-notification_body": "*header*\n\nsome text\n" + default_notification_body, "application-notification_format": 'markdown', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -369,8 +365,7 @@ def test_check_notification_email_formats_default_Text_override_HTML(client, liv "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": notification_body, "application-notification_format": 'text', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data @@ -480,8 +475,7 @@ def test_check_plaintext_document_plaintext_notification_smtp(client, live_serve "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'text', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data @@ -533,8 +527,7 @@ def test_check_plaintext_document_html_notifications(client, live_server, measur "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'html', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data @@ -613,8 +606,7 @@ def test_check_plaintext_document_html_color_notifications(client, live_server, "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'htmlcolor', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -686,8 +678,7 @@ def test_check_html_document_plaintext_notification(client, live_server, measure "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": f"{notification_body}\nMore output test\n{ALL_MARKUP_TOKENS}", "application-notification_format": 'text', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -740,8 +731,7 @@ def test_check_html_notification_with_apprise_format_is_html(client, live_server "application-notification_title": "fallback-title " + default_notification_title, "application-notification_body": "some text\nfallback-body
" + default_notification_body, "application-notification_format": 'html', - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data diff --git a/changedetectionio/tests/test_access_control.py b/changedetectionio/tests/test_access_control.py index 2b0e0fb7..24d24c59 100644 --- a/changedetectionio/tests/test_access_control.py +++ b/changedetectionio/tests/test_access_control.py @@ -32,8 +32,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da url_for("settings.settings_page"), data={"application-password": "foobar", "application-shared_diff_access": "True", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -91,8 +90,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da res = c.post( url_for("settings.settings_page"), data={ - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -132,11 +130,11 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da ################################################## # Remove password button, and check that it worked ################################################## + c.post(url_for("settings_browsers.set_default"), data={"machine_name": "browser_chromeplaywright", "csrf_token": ""}, follow_redirects=True) res = c.post( url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-browser_profile": "browser_chromeplaywright", "application-removepassword_button": "Remove password" }, follow_redirects=True, @@ -150,8 +148,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da res = c.post( url_for("settings.settings_page"), data={"application-password": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -164,8 +161,7 @@ def test_check_access_control(app, client, live_server, measure_memory_usage, da data={"application-password": "foobar", # Should be disabled "application-shared_diff_access": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_add_replace_remove_filter.py b/changedetectionio/tests/test_add_replace_remove_filter.py index cbf4f314..e0579fd2 100644 --- a/changedetectionio/tests/test_add_replace_remove_filter.py +++ b/changedetectionio/tests/test_add_replace_remove_filter.py @@ -127,8 +127,7 @@ def test_check_add_line_contains_trigger(client, live_server, measure_memory_usa # https://github.com/caronc/apprise/wiki/Notify_Custom_JSON#get-parameter-manipulation "application-notification_urls": test_notification_url, "application-notification_format": 'text', - "application-minutes_between_check": 180, - "application-browser_profile": "direct_http_requests" + "application-minutes_between_check": 180 }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_api.py b/changedetectionio/tests/test_api.py index 690dd7dd..29bbe819 100644 --- a/changedetectionio/tests/test_api.py +++ b/changedetectionio/tests/test_api.py @@ -416,7 +416,6 @@ def test_access_denied(client, live_server, measure_memory_usage, datastore_path url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-browser_profile": "direct_http_requests", "application-api_access_token_enabled": "" }, follow_redirects=True @@ -436,7 +435,6 @@ def test_access_denied(client, live_server, measure_memory_usage, datastore_path url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-browser_profile": "direct_http_requests", "application-api_access_token_enabled": "y" }, follow_redirects=True @@ -907,8 +905,7 @@ def test_api_conflict_UI_password(client, live_server, measure_memory_usage, dat url_for("settings.settings_page"), data={"application-password": "foobar", # password is now set! API should still work! "application-api_access_token_enabled": "y", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_api_openapi.py b/changedetectionio/tests/test_api_openapi.py index 9cc97a7f..e3b47403 100644 --- a/changedetectionio/tests/test_api_openapi.py +++ b/changedetectionio/tests/test_api_openapi.py @@ -177,7 +177,6 @@ def test_openapi_validation_get_requests_bypass_validation(client, live_server, url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-browser_profile": "direct_http_requests", "application-api_access_token_enabled": "" }, follow_redirects=True diff --git a/changedetectionio/tests/test_backend.py b/changedetectionio/tests/test_backend.py index 6152d101..6bfc1f4e 100644 --- a/changedetectionio/tests/test_backend.py +++ b/changedetectionio/tests/test_backend.py @@ -172,8 +172,7 @@ def test_title_scraper(client, live_server, measure_memory_usage, datastore_path res = client.post( url_for("settings.settings_page"), data={"application-ui-use_page_title_in_list": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -215,8 +214,7 @@ def test_requests_timeout(client, live_server, measure_memory_usage, datastore_p url_for("settings.settings_page"), data={"application-ui-use_page_title_in_list": "", "requests-time_between_check-minutes": 180, - "requests-timeout": delay - 1, - 'application-browser_profile': "direct_http_requests"}, + "requests-timeout": delay - 1}, follow_redirects=True ) @@ -234,8 +232,7 @@ def test_requests_timeout(client, live_server, measure_memory_usage, datastore_p url_for("settings.settings_page"), data={"application-ui-use_page_title_in_list": "", "requests-time_between_check-minutes": 180, - "requests-timeout": delay + 1, # timeout should be a second more than the reply time - 'application-browser_profile': "direct_http_requests"}, + "requests-timeout": delay + 1}, # timeout should be a second more than the reply time follow_redirects=True ) client.get(url_for("ui.form_watch_checknow"), follow_redirects=True) diff --git a/changedetectionio/tests/test_basic_socketio.py b/changedetectionio/tests/test_basic_socketio.py index 22eed8f4..9147baab 100644 --- a/changedetectionio/tests/test_basic_socketio.py +++ b/changedetectionio/tests/test_basic_socketio.py @@ -118,8 +118,7 @@ def test_everything(live_server, client, measure_memory_usage, datastore_path): res = client.post( url_for("settings.settings_page"), data={"application-password": "foobar", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_history_consistency.py b/changedetectionio/tests/test_history_consistency.py index 926b77cb..74f33e0d 100644 --- a/changedetectionio/tests/test_history_consistency.py +++ b/changedetectionio/tests/test_history_consistency.py @@ -50,8 +50,7 @@ def test_consistent_history(client, live_server, measure_memory_usage, datastore res = client.post( url_for("settings.settings_page"), data={"application-empty_pages_are_a_change": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data diff --git a/changedetectionio/tests/test_ignore.py b/changedetectionio/tests/test_ignore.py index e6b41a16..dea81986 100644 --- a/changedetectionio/tests/test_ignore.py +++ b/changedetectionio/tests/test_ignore.py @@ -68,8 +68,7 @@ def test_strip_ignore_lines(client, live_server, measure_memory_usage, datastore "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", "application-strip_ignored_lines": "y", - "application-global_ignore_text": "Which is across multiple", - 'application-browser_profile': "direct_http_requests" + "application-global_ignore_text": "Which is across multiple" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_ignore_text.py b/changedetectionio/tests/test_ignore_text.py index 6d819163..9bfb20b0 100644 --- a/changedetectionio/tests/test_ignore_text.py +++ b/changedetectionio/tests/test_ignore_text.py @@ -181,8 +181,7 @@ def _run_test_global_ignore(client, datastore_path, as_source=False, extra_ignor data={ "requests-time_between_check-minutes": 180, "application-ignore_whitespace": "y", - "application-global_ignore_text": ignore_text, - 'application-browser_profile': "direct_http_requests" + "application-global_ignore_text": ignore_text }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_ignorehyperlinks.py b/changedetectionio/tests/test_ignorehyperlinks.py index c6de2946..2f2e7af0 100644 --- a/changedetectionio/tests/test_ignorehyperlinks.py +++ b/changedetectionio/tests/test_ignorehyperlinks.py @@ -53,7 +53,6 @@ def test_render_anchor_tag_content_true(client, live_server, measure_memory_usag url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-browser_profile": "direct_http_requests", }, follow_redirects=True, ) @@ -90,7 +89,6 @@ def test_render_anchor_tag_content_true(client, live_server, measure_memory_usag data={ "requests-time_between_check-minutes": 180, "application-render_anchor_tag_content": "true", - "application-browser_profile": "direct_http_requests", }, follow_redirects=True, ) diff --git a/changedetectionio/tests/test_ignorestatuscode.py b/changedetectionio/tests/test_ignorestatuscode.py index 0ea7840f..3cc01032 100644 --- a/changedetectionio/tests/test_ignorestatuscode.py +++ b/changedetectionio/tests/test_ignorestatuscode.py @@ -49,8 +49,7 @@ def test_normal_page_check_works_with_ignore_status_code(client, live_server, me url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-ignore_status_codes": "y", - 'application-browser_profile': "direct_http_requests" + "application-ignore_status_codes": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_ignorewhitespace.py b/changedetectionio/tests/test_ignorewhitespace.py index d5a8a0c6..cc44ca19 100644 --- a/changedetectionio/tests/test_ignorewhitespace.py +++ b/changedetectionio/tests/test_ignorewhitespace.py @@ -58,8 +58,7 @@ def test_check_ignore_whitespace(client, live_server, measure_memory_usage, data url_for("settings.settings_page"), data={ "requests-time_between_check-minutes": 180, - "application-ignore_whitespace": "y", - "application-browser_profile": "direct_http_requests" + "application-ignore_whitespace": "y" }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_nonrenderable_pages.py b/changedetectionio/tests/test_nonrenderable_pages.py index 2578b803..764f24d2 100644 --- a/changedetectionio/tests/test_nonrenderable_pages.py +++ b/changedetectionio/tests/test_nonrenderable_pages.py @@ -50,8 +50,7 @@ def test_check_basic_change_detection_functionality(client, live_server, measure client.post( url_for("settings.settings_page"), data={"application-empty_pages_are_a_change": "", # default, OFF, they are NOT a change - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -81,8 +80,7 @@ def test_check_basic_change_detection_functionality(client, live_server, measure client.post( url_for("settings.settings_page"), data={"application-empty_pages_are_a_change": "y", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) set_modified_response(datastore_path=datastore_path) diff --git a/changedetectionio/tests/test_notification.py b/changedetectionio/tests/test_notification.py index 8bc2d86d..5f8d9004 100644 --- a/changedetectionio/tests/test_notification.py +++ b/changedetectionio/tests/test_notification.py @@ -41,8 +41,7 @@ def test_check_notification(client, live_server, measure_memory_usage, datastore "application-notification_title": "fallback-title "+default_notification_title, "application-notification_body": "fallback-body "+default_notification_body, "application-notification_format": default_notification_format, - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) @@ -282,7 +281,6 @@ def test_notification_urls_jinja2_apprise_integration(client, live_server, measu res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444, "somebug": "网站监测 内容更新了", "another": "{{diff|truncate(1500)}}" }', "application-notification_format": default_notification_format, @@ -314,7 +312,6 @@ def test_notification_custom_endpoint_and_jinja2(client, live_server, measure_me res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "application-notification_body": '{ "url" : "{{ watch_url }}", "secret": 444, "somebug": "网站监测 内容更新了" }', "application-notification_format": default_notification_format, @@ -399,7 +396,6 @@ def test_global_send_test_notification(client, live_server, measure_memory_usage res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "application-notification_body": test_body, "application-notification_format": default_notification_format, @@ -556,7 +552,6 @@ def _test_color_notifications(client, notification_body_token, datastore_path): res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "application-notification_body": notification_body_token, "application-notification_format": "htmlcolor", diff --git a/changedetectionio/tests/test_request.py b/changedetectionio/tests/test_request.py index bdf88814..0e11a98f 100644 --- a/changedetectionio/tests/test_request.py +++ b/changedetectionio/tests/test_request.py @@ -253,7 +253,6 @@ def test_ua_global_override(client, live_server, measure_memory_usage, datastore res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "requests-default_ua-html_requests": "html-requests-user-agent" }, @@ -311,7 +310,6 @@ def test_headers_textfile_in_request(client, live_server, measure_memory_usage, test_url = test_url.replace('localhost', 'cdio') form_data = { - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "requests-default_ua-html_requests": requests_ua } diff --git a/changedetectionio/tests/test_restock_itemprop.py b/changedetectionio/tests/test_restock_itemprop.py index 84444e12..10537303 100644 --- a/changedetectionio/tests/test_restock_itemprop.py +++ b/changedetectionio/tests/test_restock_itemprop.py @@ -361,8 +361,7 @@ def test_change_with_notification_values(client, live_server, measure_memory_usa "application-notification_title": "title new price {{restock.price}}", "application-notification_body": "new price {{restock.price}} previous price {{restock.previous_price}} instock {{restock.in_stock}}", "application-notification_format": default_notification_format, - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_rss_single_watch.py b/changedetectionio/tests/test_rss_single_watch.py index 9753bc4d..be5ed504 100644 --- a/changedetectionio/tests/test_rss_single_watch.py +++ b/changedetectionio/tests/test_rss_single_watch.py @@ -273,7 +273,6 @@ def test_rss_single_watch_follow_notification_body(client, live_server, measure_ res = client.post( url_for("settings.settings_page"), data={ - "application-browser_profile": "direct_http_requests", "application-minutes_between_check": 180, "application-notification_body": 'Boo yeah hello from main settings notification body
\nTitle: {{ watch_title }} changed', "application-notification_format": default_notification_format, diff --git a/changedetectionio/tests/test_scheduler.py b/changedetectionio/tests/test_scheduler.py index 835cc069..dbaa3613 100644 --- a/changedetectionio/tests/test_scheduler.py +++ b/changedetectionio/tests/test_scheduler.py @@ -24,8 +24,7 @@ def test_check_basic_scheduler_functionality(client, live_server, measure_memory url_for("settings.settings_page"), data={"application-empty_pages_are_a_change": "", "requests-time_between_check-seconds": 1, - "application-scheduler_timezone_default": "Pacific/Kiritimati", # Most Forward Time Zone (UTC+14:00) - 'application-browser_profile': "direct_http_requests"}, + "application-scheduler_timezone_default": "Pacific/Kiritimati"}, # Most Forward Time Zone (UTC+14:00) follow_redirects=True ) @@ -120,7 +119,6 @@ def test_check_basic_global_scheduler_functionality(client, live_server, measure data = { "application-empty_pages_are_a_change": "", "application-scheduler_timezone_default": "Pacific/Kiritimati", # Most Forward Time Zone (UTC+14:00) - 'application-browser_profile': "direct_http_requests", "requests-time_between_check-hours": 0, "requests-time_between_check-minutes": 0, "requests-time_between_check-seconds": 1, diff --git a/changedetectionio/tests/test_security.py b/changedetectionio/tests/test_security.py index 51bcaf13..5463cfda 100644 --- a/changedetectionio/tests/test_security.py +++ b/changedetectionio/tests/test_security.py @@ -159,8 +159,7 @@ def test_xss(client, live_server, measure_memory_usage, datastore_path): "application-notification_title": '">', "application-notification_body": '">', "application-notification_format": default_notification_format, - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) diff --git a/changedetectionio/tests/test_settings_tag_force_reprocess.py b/changedetectionio/tests/test_settings_tag_force_reprocess.py index fc3272d7..50885af6 100644 --- a/changedetectionio/tests/test_settings_tag_force_reprocess.py +++ b/changedetectionio/tests/test_settings_tag_force_reprocess.py @@ -54,8 +54,7 @@ def test_settings_change_forces_reprocess(client, live_server, measure_memory_us url_for("settings.settings_page"), data={ "application-empty_pages_are_a_change": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests" + "requests-time_between_check-minutes": 180 }, follow_redirects=True ) diff --git a/changedetectionio/tests/test_ui.py b/changedetectionio/tests/test_ui.py index d633dba0..5fa09ce8 100644 --- a/changedetectionio/tests/test_ui.py +++ b/changedetectionio/tests/test_ui.py @@ -179,8 +179,7 @@ def test_page_title_listing_behaviour(client, live_server, measure_memory_usage, res = client.post( url_for("settings.settings_page"), data={"application-ui-use_page_title_in_list": "", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data @@ -219,8 +218,7 @@ def test_page_title_listing_behaviour(client, live_server, measure_memory_usage, res = client.post( url_for("settings.settings_page"), data={"application-ui-use_page_title_in_list": "y", - "requests-time_between_check-minutes": 180, - 'application-browser_profile': "direct_http_requests"}, + "requests-time_between_check-minutes": 180}, follow_redirects=True ) assert b"Settings updated." in res.data diff --git a/changedetectionio/worker.py b/changedetectionio/worker.py index 41bcd29c..8e19d2a6 100644 --- a/changedetectionio/worker.py +++ b/changedetectionio/worker.py @@ -378,6 +378,11 @@ async def async_update_worker(worker_id, q, notification_q, app, datastore, exec process_changedetection_results = False logger.error(f"Exception (BrowserStepsInUnsupportedFetcher) reached processing watch UUID: {uuid}") + except KeyError as e: + # Watch was deleted between being queued and processed — skip + logger.warning(f"Worker {worker_id} skipping UUID {uuid}: {e}") + process_changedetection_results = False + except Exception as e: import traceback logger.error(f"Worker {worker_id} exception processing watch UUID: {uuid}")