From 9874f0cbc7a06b170cdc7ffca6f10b833a6be755 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 27 Oct 2022 12:43:02 +0200 Subject: [PATCH 1/4] Remove accidental files --- changedetectionio/download.zip | Bin 2083 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 changedetectionio/download.zip diff --git a/changedetectionio/download.zip b/changedetectionio/download.zip deleted file mode 100644 index b4658ada34a5d6b6c022ae832c7ba91ec5aaf905..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2083 zcmWIWW@Zs#U|`^2*c=rdy5X@{*$rj}hEg5|1_7XGX;F@Dd16U&MryHMR&jpb(Jl#XMT?%S zo|t^kqb_1|*)L_SzkFX#A%A>Hs9AwmsYJj{p?KAhF5F3UT(klK0iNi%EJXwkN>63~kT#MUF z?uYDZxHI!!(Z2Mo-i@*?S03H(KbI`dnX@1~KkDh36|et3+Fkry;%vA3?i*1VYd3N~ zYnjaYPMop0)>h+0bqb$o?~IL`7gTDOTW{&^J5>HG>azC16&7L2i_aCWNZ%^Gq%zg? zf=5Q-tZjaV-SuBh;`5@OuB^M(5aJ^6hR3?RXo7E|@h!#o?YqvMy?f?|&0>*Rjg8gs zx^9YdPCiqms~Nd$iJZ+j&39`nBVI`ATdQ>ZVGNwV;vp~p+zQ^0=g#huIKtE?zT}I< zx27GFXZ?ED#Kf4f<;SW5wfTOZ8M6~Pvrn^VMQHqTec7G-Ltq}eqRvRxE}3k9dj7gNQMawt{=bjR)t^#n*FFFDx3hYj6Mf{} z6z>0-ue;%2|NZ~nUlNbR=`1@S-?P_Rar#p6V^6Zw9C&{3m5P3#duYRS9t-zHp7|ZV z5?L#*IxN5UE#FOO&f<`1C$=rKZt4AP|4&_}@$NnOn{s6@Bm`0!tz!+jU;USp{WVQu zovF(q2YshVmJ`d{kNM4%68U{hPj>6Qy^3z-?O{RTZyO)~5suKBxM}(4wWeGA65K@= z{LS<~llb|sw(Y;f1AmTRpZ++1y~tvfDjB}x558&E9skxJ|I%HzgX7riFTXbXO?tAq zPGnQ&ykqtsfAh8aGyZ=WrRMaaK`?w*@b&5Uop(%Yd-OG@B_pCEG;n$5-6h!`n{%R{ zhn`!wW}A(ESb&f5%yZ!%0zYpOoSl2Bd(#>ty-i=Ux+mmsoAEhU&1H|ns$|QYJ(D}@ z*I!;QZo_MNyLb7sf|Spq@z3|HnPeJ&-7{|8>Xg|}SGPQRdelsNvk^!yYqOfLHR7%^|UFGXT3E~oIj)e@F^3Tfs7o-5;TAYsR6MVl7YJAnI##zC5h?9L>e9V0BklR zlL#~J8U$zo7;I?-QRwwafHy)nwv-3a%fPUuk&Oj89U|+)maGu^5`p@NiZo&q8M@Wz zDFk7)AS;npBc&H))3L=q!t}{N(?P)rOAF{a(W4om^9hnp)JPBTW@Q7ZV*|pojKBf_ G%mV Date: Thu, 27 Oct 2022 13:29:24 +0200 Subject: [PATCH 2/4] Re #1052 - Watch 'open' link should use any dynamic/template info (#1063) --- changedetectionio/fetch_site_status.py | 6 +----- changedetectionio/model/Watch.py | 10 ++++++++++ changedetectionio/templates/watch-overview.html | 2 +- requirements.txt | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/changedetectionio/fetch_site_status.py b/changedetectionio/fetch_site_status.py index 76c821be8..54587dff1 100644 --- a/changedetectionio/fetch_site_status.py +++ b/changedetectionio/fetch_site_status.py @@ -35,8 +35,6 @@ class perform_site_check(): def run(self, uuid): - from jinja2 import Environment - changed_detected = False screenshot = False # as bytes stripped_text_from_html = "" @@ -68,9 +66,7 @@ class perform_site_check(): timeout = self.datastore.data['settings']['requests'].get('timeout') - # Jinja2 available in URLs along with https://pypi.org/project/jinja2-time/ - jinja2_env = Environment(extensions=['jinja2_time.TimeExtension']) - url = str(jinja2_env.from_string(watch.get('url')).render()) + url = watch.link request_body = self.datastore.data['watching'][uuid].get('body') request_method = self.datastore.data['watching'][uuid].get('method') diff --git a/changedetectionio/model/Watch.py b/changedetectionio/model/Watch.py index ce4b7814a..2be62d331 100644 --- a/changedetectionio/model/Watch.py +++ b/changedetectionio/model/Watch.py @@ -88,6 +88,16 @@ class model(dict): print ("> Creating data dir {}".format(self.watch_data_dir)) os.mkdir(self.watch_data_dir) + @property + def link(self): + url = self.get('url', '') + if '{%' in url or '{{' in url: + from jinja2 import Environment + # Jinja2 available in URLs along with https://pypi.org/project/jinja2-time/ + jinja2_env = Environment(extensions=['jinja2_time.TimeExtension']) + return str(jinja2_env.from_string(url).render()) + return url + @property def label(self): # Used for sorting diff --git a/changedetectionio/templates/watch-overview.html b/changedetectionio/templates/watch-overview.html index 63dc44de3..c7c4c45e8 100644 --- a/changedetectionio/templates/watch-overview.html +++ b/changedetectionio/templates/watch-overview.html @@ -87,7 +87,7 @@ Mute notifications {{watch.title if watch.title is not none and watch.title|length > 0 else watch.url}} - + {%if watch.fetch_backend == "html_webdriver" %}{% endif %} diff --git a/requirements.txt b/requirements.txt index 4bf29823d..615ca55a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -47,7 +47,7 @@ selenium ~= 4.1.0 werkzeug ~= 2.0.0 # Templating, so far just in the URLs but in the future can be for the notifications also -jinja2 +jinja2 ~= 3.1 jinja2-time # playwright is installed at Dockerfile build time because it's not available on all platforms From 8499468749bc936e56ba18f3739825b74885276e Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Thu, 27 Oct 2022 15:17:14 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0f1678289..9ab279bf2 100644 --- a/README.md +++ b/README.md @@ -184,9 +184,9 @@ When you enable a `json:` or `jq:` filter, you can even automatically extract an `json:$.price` or `jq:.price` would give `23.50`, or you can extract the whole structure -## Proxy configuration +## Proxy Configuration -See the wiki https://github.com/dgtlmoon/changedetection.io/wiki/Proxy-configuration +See the wiki https://github.com/dgtlmoon/changedetection.io/wiki/Proxy-configuration , we also support using [BrightData proxy services where possible]( https://github.com/dgtlmoon/changedetection.io/wiki/Proxy-configuration#brightdata-proxy-support) ## Raspberry Pi support? From 57f604dff1580ec49e58469edf616b83f0af9758 Mon Sep 17 00:00:00 2001 From: Sandro Date: Thu, 27 Oct 2022 16:40:24 +0200 Subject: [PATCH 4/4] UI - Make fetch error more readable (#1038) --- changedetectionio/static/styles/styles.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/changedetectionio/static/styles/styles.scss b/changedetectionio/static/styles/styles.scss index e8b4a6ab8..c2772d323 100644 --- a/changedetectionio/static/styles/styles.scss +++ b/changedetectionio/static/styles/styles.scss @@ -156,7 +156,7 @@ body:after, body:before { .fetch-error { padding-top: 1em; - font-size: 60%; + font-size: 80%; max-width: 400px; display: block; } @@ -803,4 +803,4 @@ ul { padding: 0.5rem; border-radius: 5px; color: #ff3300; -} \ No newline at end of file +}