mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-11-08 18:47:32 +00:00
Compare commits
1 Commits
restock-pr
...
add-check-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
404b13a429 |
@@ -16,42 +16,43 @@ class model(dict):
|
|||||||
__newest_history_key = None
|
__newest_history_key = None
|
||||||
__history_n=0
|
__history_n=0
|
||||||
__base_config = {
|
__base_config = {
|
||||||
'url': None,
|
#'history': {}, # Dict of timestamp and output stripped filename (removed)
|
||||||
'tag': None,
|
#'newest_history_key': 0, (removed, taken from history.txt index)
|
||||||
'last_checked': 0,
|
|
||||||
'paused': False,
|
|
||||||
'last_viewed': 0, # history key value of the last viewed via the [diff] link
|
|
||||||
#'newest_history_key': 0,
|
|
||||||
'title': None,
|
|
||||||
'previous_md5': False,
|
|
||||||
'uuid': str(uuid.uuid4()),
|
|
||||||
'headers': {}, # Extra headers to send
|
|
||||||
'body': None,
|
'body': None,
|
||||||
'method': 'GET',
|
'check_unique_lines': False, # On change-detected, compare against all history if its something new
|
||||||
#'history': {}, # Dict of timestamp and output stripped filename
|
'check_count': 0,
|
||||||
|
'consecutive_filter_failures': 0, # Every time the CSS/xPath filter cannot be located, reset when all is fine.
|
||||||
|
'extract_text': [], # Extract text by regex after filters
|
||||||
|
'extract_title_as_title': False,
|
||||||
|
'fetch_backend': None,
|
||||||
|
'filter_failure_notification_send': strtobool(os.getenv('FILTER_FAILURE_NOTIFICATION_SEND_DEFAULT', 'True')),
|
||||||
|
'headers': {}, # Extra headers to send
|
||||||
'ignore_text': [], # List of text to ignore when calculating the comparison checksum
|
'ignore_text': [], # List of text to ignore when calculating the comparison checksum
|
||||||
# Custom notification content
|
'include_filters': [],
|
||||||
'notification_urls': [], # List of URLs to add to the notification Queue (Usually AppRise)
|
'last_checked': 0,
|
||||||
'notification_title': None,
|
'last_error': False,
|
||||||
|
'last_viewed': 0, # history key value of the last viewed via the [diff] link
|
||||||
|
'method': 'GET',
|
||||||
|
# Custom notification content
|
||||||
'notification_body': None,
|
'notification_body': None,
|
||||||
'notification_format': default_notification_format_for_watch,
|
'notification_format': default_notification_format_for_watch,
|
||||||
'notification_muted': False,
|
'notification_muted': False,
|
||||||
'include_filters': [],
|
'notification_title': None,
|
||||||
'last_error': False,
|
'notification_urls': [], # List of URLs to add to the notification Queue (Usually AppRise)
|
||||||
'extract_text': [], # Extract text by regex after filters
|
'paused': False,
|
||||||
'subtractive_selectors': [],
|
'previous_md5': False,
|
||||||
'trigger_text': [], # List of text or regex to wait for until a change is detected
|
|
||||||
'text_should_not_be_present': [], # Text that should not present
|
|
||||||
'fetch_backend': None,
|
|
||||||
'filter_failure_notification_send': strtobool(os.getenv('FILTER_FAILURE_NOTIFICATION_SEND_DEFAULT', 'True')),
|
|
||||||
'consecutive_filter_failures': 0, # Every time the CSS/xPath filter cannot be located, reset when all is fine.
|
|
||||||
'extract_title_as_title': False,
|
|
||||||
'check_unique_lines': False, # On change-detected, compare against all history if its something new
|
|
||||||
'proxy': None, # Preferred proxy connection
|
'proxy': None, # Preferred proxy connection
|
||||||
|
'subtractive_selectors': [],
|
||||||
|
'tag': None,
|
||||||
|
'text_should_not_be_present': [], # Text that should not present
|
||||||
# Re #110, so then if this is set to None, we know to use the default value instead
|
# Re #110, so then if this is set to None, we know to use the default value instead
|
||||||
# Requires setting to None on submit if it's the same as the default
|
# Requires setting to None on submit if it's the same as the default
|
||||||
# Should be all None by default, so we use the system default in this case.
|
# Should be all None by default, so we use the system default in this case.
|
||||||
'time_between_check': {'weeks': None, 'days': None, 'hours': None, 'minutes': None, 'seconds': None},
|
'time_between_check': {'weeks': None, 'days': None, 'hours': None, 'minutes': None, 'seconds': None},
|
||||||
|
'title': None,
|
||||||
|
'trigger_text': [], # List of text or regex to wait for until a change is detected
|
||||||
|
'url': None,
|
||||||
|
'uuid': str(uuid.uuid4()),
|
||||||
'webdriver_delay': None,
|
'webdriver_delay': None,
|
||||||
'webdriver_js_execute_code': None, # Run before change-detection
|
'webdriver_js_execute_code': None, # Run before change-detection
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,10 +282,12 @@ class update_worker(threading.Thread):
|
|||||||
self.app.logger.error("Exception reached processing watch UUID: %s - %s", uuid, str(e))
|
self.app.logger.error("Exception reached processing watch UUID: %s - %s", uuid, str(e))
|
||||||
self.datastore.update_watch(uuid=uuid, update_obj={'last_error': str(e)})
|
self.datastore.update_watch(uuid=uuid, update_obj={'last_error': str(e)})
|
||||||
|
|
||||||
|
|
||||||
# Always record that we atleast tried
|
# Always record that we atleast tried
|
||||||
|
count = self.datastore.data['watching'][uuid].get('check_count', 0) + 1
|
||||||
self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3),
|
self.datastore.update_watch(uuid=uuid, update_obj={'fetch_time': round(time.time() - now, 3),
|
||||||
'last_checked': round(time.time())})
|
'last_checked': round(time.time()),
|
||||||
|
'check_count': count
|
||||||
|
})
|
||||||
|
|
||||||
# Always save the screenshot if it's available
|
# Always save the screenshot if it's available
|
||||||
if update_handler.screenshot:
|
if update_handler.screenshot:
|
||||||
|
|||||||
Reference in New Issue
Block a user