|
|
|
@ -2,9 +2,9 @@ from abc import abstractmethod
|
|
|
|
|
import os
|
|
|
|
|
import hashlib
|
|
|
|
|
import re
|
|
|
|
|
from copy import deepcopy
|
|
|
|
|
|
|
|
|
|
from changedetectionio import content_fetcher
|
|
|
|
|
from copy import deepcopy
|
|
|
|
|
from distutils.util import strtobool
|
|
|
|
|
|
|
|
|
|
class difference_detection_processor():
|
|
|
|
|
|
|
|
|
@ -19,15 +19,15 @@ class difference_detection_processor():
|
|
|
|
|
self.datastore = datastore
|
|
|
|
|
self.watch = deepcopy(self.datastore.data['watching'].get(watch_uuid))
|
|
|
|
|
|
|
|
|
|
def call_browser(self):
|
|
|
|
|
|
|
|
|
|
# Protect against file:// access
|
|
|
|
|
if re.search(r'^file', self.watch.get('url', ''), re.IGNORECASE) and not os.getenv('ALLOW_FILE_URI', False):
|
|
|
|
|
if re.search(r'^file://', self.watch.get('url', '').strip(), re.IGNORECASE):
|
|
|
|
|
if not strtobool(os.getenv('ALLOW_FILE_URI', 'false')):
|
|
|
|
|
raise Exception(
|
|
|
|
|
"file:// type access is denied for security reasons."
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def call_browser(self):
|
|
|
|
|
|
|
|
|
|
url = self.watch.link
|
|
|
|
|
|
|
|
|
|
# Requests, playwright, other browser via wss:// etc, fetch_extra_something
|
|
|
|
|