Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New changes for mindtouch #1053

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions dispatcher/backend/src/common/schemas/offliners/mindtouch.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,16 +171,23 @@ class Meta:
metadata={"label": "Debug", "description": "Enable verbose output"},
)

html_issues_warn_only = fields.Boolean(
truthy=[True],
falsy=[False],
bad_assets_regex = String(
metadata={
"label": "Bad assets regex",
"description": "Regular expression of asset URLs known to not be available."
"Case insensitive.",
},
data_key="bad-assets-regex",
)

bad_assets_threshold = fields.Integer(
metadata={
"label": "HTML issues warn only",
"description": "[dev] Only log a warning when unexpected HTML is "
"encountered. Use with caution because activating this option means that "
"ZIM HTML will probably lead to online resources without user noticing it.",
"label": "Bad assets threshold",
"description": "[dev] Number of assets allowed to fail to download before "
"failing the scraper. Assets already excluded with --bad-assets-regex are "
"not counted for this threshold. Defaults to 10 assets.",
},
data_key="html-issues-warn-only",
data_key="bad-assets-threshold",
)

stats_filename = String(
Expand Down