changedetection.io/changedetectionio/model/App.py

51 wiersze
2.4 KiB
Python
Czysty Zwykły widok Historia

2022-07-23 11:18:44 +00:00
from os import getenv
2022-04-19 19:43:07 +00:00
from changedetectionio.notification import (
default_notification_body,
default_notification_format,
default_notification_title,
)
_FILTER_FAILURE_THRESHOLD_ATTEMPTS_DEFAULT = 6
2022-04-19 19:43:07 +00:00
class model(dict):
base_config = {
2022-04-19 19:43:07 +00:00
'note': "Hello! If you change this file manually, please be sure to restart your changedetection.io instance!",
'watching': {},
'settings': {
'headers': {
},
'requests': {
'extra_proxies': [], # Configurable extra proxies via the UI
'jitter_seconds': 0,
'proxy': None, # Preferred proxy connection
'time_between_check': {'weeks': None, 'days': None, 'hours': 3, 'minutes': None, 'seconds': None},
'timeout': int(getenv("DEFAULT_SETTINGS_REQUESTS_TIMEOUT", "45")), # Default 45 seconds
2022-07-23 11:18:44 +00:00
'workers': int(getenv("DEFAULT_SETTINGS_REQUESTS_WORKERS", "10")), # Number of threads, lower is better for slow connections
2022-04-19 19:43:07 +00:00
},
'application': {
2022-05-20 14:27:51 +00:00
'api_access_token_enabled': True,
2022-04-19 19:43:07 +00:00
'password': False,
'base_url' : None,
'extract_title_as_title': False,
'empty_pages_are_a_change': False,
2022-07-23 11:18:44 +00:00
'fetch_backend': getenv("DEFAULT_FETCH_BACKEND", "html_requests"),
'filter_failure_notification_threshold_attempts': _FILTER_FAILURE_THRESHOLD_ATTEMPTS_DEFAULT,
2022-04-19 19:43:07 +00:00
'global_ignore_text': [], # List of text to ignore when calculating the comparison checksum
'global_subtractive_selectors': [],
2022-05-28 11:30:27 +00:00
'ignore_whitespace': True,
2022-04-19 19:43:07 +00:00
'render_anchor_tag_content': False,
'notification_urls': [], # Apprise URL list
# Custom notification content
'notification_title': default_notification_title,
'notification_body': default_notification_body,
'notification_format': default_notification_format,
'schema_version' : 0,
'webdriver_delay': None # Extra delay in seconds before extracting text
2022-04-19 19:43:07 +00:00
}
}
}
def __init__(self, *arg, **kw):
super(model, self).__init__(*arg, **kw)
self.update(self.base_config)