2022-04-19 19:43:07 +00:00
import collections
import os
import uuid as uuid_builder
from changedetectionio . notification import (
default_notification_body ,
default_notification_format ,
default_notification_title ,
)
class model ( dict ) :
2022-04-24 14:56:32 +00:00
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 ' : {
2022-07-08 18:04:06 +00:00
' User-Agent ' : os . getenv ( " DEFAULT_SETTINGS_HEADERS_USERAGENT " , ' Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36 ' ) ,
2022-04-19 19:43:07 +00:00
' Accept ' : ' text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 ' ,
' Accept-Encoding ' : ' gzip, deflate ' , # No support for brolti in python requests yet.
' Accept-Language ' : ' en-GB,en-US;q=0.9,en; '
} ,
' requests ' : {
2022-07-08 18:04:06 +00:00
' timeout ' : int ( os . getenv ( " DEFAULT_SETTINGS_REQUESTS_TIMEOUT " , " 45 " ) ) , # Default 45 seconds
2022-04-24 14:56:32 +00:00
' time_between_check ' : { ' weeks ' : None , ' days ' : None , ' hours ' : 3 , ' minutes ' : None , ' seconds ' : None } ,
2022-06-13 10:41:53 +00:00
' jitter_seconds ' : 0 ,
2022-07-08 18:04:06 +00:00
' workers ' : int ( os . getenv ( " DEFAULT_SETTINGS_REQUESTS_WORKERS " , " 10 " ) ) , # Number of threads, lower is better for slow connections
2022-05-08 18:35:36 +00:00
' proxy ' : None # Preferred proxy connection
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 ,
2022-05-17 20:22:00 +00:00
' empty_pages_are_a_change ' : False ,
2022-04-19 21:15:00 +00:00
' fetch_backend ' : os . getenv ( " DEFAULT_FETCH_BACKEND " , " html_requests " ) ,
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 ,
' real_browser_save_screenshot ' : True ,
2022-05-17 16:35:33 +00:00
' schema_version ' : 0 ,
' webdriver_delay ' : None # Extra delay in seconds before extracting text
2022-04-19 19:43:07 +00:00
}
}
2022-04-24 14:56:32 +00:00
}
def __init__ ( self , * arg , * * kw ) :
super ( model , self ) . __init__ ( * arg , * * kw )
self . update ( self . base_config )