diff --git a/changedetectionio/__init__.py b/changedetectionio/__init__.py index d07a52ed..67d2f0be 100644 --- a/changedetectionio/__init__.py +++ b/changedetectionio/__init__.py @@ -700,6 +700,7 @@ def changedetection_app(config=None, datastore_o=None): form=form, has_default_notification_urls=True if len(datastore.data['settings']['application']['notification_urls']) else False, has_empty_checktime=using_default_check_time, + has_extra_headers_file=watch.has_extra_headers_file or datastore.has_extra_headers_file, is_html_webdriver=is_html_webdriver, jq_support=jq_support, playwright_enabled=os.getenv('PLAYWRIGHT_DRIVER_URL', False), diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index 923ef6d1..2e6d6f43 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -473,6 +473,7 @@ class model(dict): # None is set return False + @property def has_extra_headers_file(self): if os.path.isfile(os.path.join(self.watch_data_dir, 'headers.txt')): return True diff --git a/changedetectionio/store.py b/changedetectionio/store.py index c5cedbf7..5e071ce5 100644 --- a/changedetectionio/store.py +++ b/changedetectionio/store.py @@ -505,6 +505,7 @@ class ChangeDetectionStore: return None + @property def has_extra_headers_file(self): filepath = os.path.join(self.datastore_path, 'headers.txt') return os.path.isfile(filepath) diff --git a/changedetectionio/templates/edit.html b/changedetectionio/templates/edit.html index 805c79c7..63b96455 100644 --- a/changedetectionio/templates/edit.html +++ b/changedetectionio/templates/edit.html @@ -152,6 +152,11 @@ {{ render_field(form.headers, rows=5, placeholder="Example Cookie: foobar User-Agent: wonderbra 1.0") }} + {% if has_extra_headers_file %} +
+ {% endif %}