Fixed privacy plugin not replacing occurrences
This commit is contained in:
parent
3bd81bdc66
commit
523922b383
|
|
@ -433,7 +433,7 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||
# Intercept errors of type `ConnectionError` and `HTTPError`
|
||||
except Exception as error:
|
||||
log.warning(f"Couldn't retrieve {file.url}: {error}")
|
||||
return
|
||||
return False
|
||||
|
||||
# Compute expected file extension and append if missing
|
||||
mime = res.headers["content-type"].split(";")[0]
|
||||
|
|
@ -484,6 +484,9 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||
if not self._is_excluded(url, file):
|
||||
self._queue(url, config, concurrent = True)
|
||||
|
||||
# External asset was successfully downloaded
|
||||
return True
|
||||
|
||||
# Patch all links to external assets in the given file
|
||||
def _patch(self, initiator: File):
|
||||
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||
# Intercept errors of type `ConnectionError` and `HTTPError`
|
||||
except Exception as error:
|
||||
log.warning(f"Couldn't retrieve {file.url}: {error}")
|
||||
return
|
||||
return False
|
||||
|
||||
# Compute expected file extension and append if missing
|
||||
mime = res.headers["content-type"].split(";")[0]
|
||||
|
|
@ -484,6 +484,9 @@ class PrivacyPlugin(BasePlugin[PrivacyConfig]):
|
|||
if not self._is_excluded(url, file):
|
||||
self._queue(url, config, concurrent = True)
|
||||
|
||||
# External asset was successfully downloaded
|
||||
return True
|
||||
|
||||
# Patch all links to external assets in the given file
|
||||
def _patch(self, initiator: File):
|
||||
with open(initiator.abs_src_path, encoding = "utf-8-sig") as f:
|
||||
|
|
|
|||
Loading…
Reference in New Issue