New flag to try known charsets when bad encoding is specified in HTTP or HTML#459
Merged
Conversation
b366764 to
9e5a0e9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
--ignore-unknown-charsetsflag which allows warc2zim to ignore charset found in HTTP headers or HTML if it fails to decode because it is unknown.When this happens, currently the scraper is just halted for typically stupid reasons like in https://farm.openzim.org/pipeline/71c03b16-124d-4ee1-ac22-218c2a1392a1
When such an error occurs, it is probably worth to try to decode with
--charsets-to-tryvalues.Unknown encodings are stored so they are reported at the end, giving a chance to fix them in next invocations.