mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2026-11-03 12:34:58 +00:00
* Log puremagic 'Could not identify file' at debug, not warning puremagic raises PureError when no signature matches, which is the normal result for plain text and most HTML pages. guess_stream_type() caught it with every other exception and logged a warning on many checks, although the content-based detection that follows handles it as designed. Other puremagic failures still log a warning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Skip puremagic on empty content and catch PureError directly puremagic.magic_string() raises ValueError('Input was empty') for empty input, which is as normal as an unidentified signature, so skip the call then. Import puremagic before the try (it is a hard dependency) so the except clause can name PureError instead of comparing the class name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Keep the puremagic import inside the try so a missing library falls back ImportError is caught before puremagic.PureError, so that clause is only evaluated once the import has succeeded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Change detection post-processors
The concept here is to be able to switch between different domain specific problems to solve.
text_json_diffThe traditional text and JSON comparison handlerrestock_diffOnly cares about detecting if a product looks like it has some text that suggests that it's out of stock, otherwise assumes that it's in stock.
Some suggestions for the future
graphical
API schema extension (api.yaml)
A processor can extend the Watch/Tag API schema by placing an api.yaml alongside its __init__.py.
Define a components.schemas.processor_config_<name> entry and it will be merged into WatchBase at startup,
making processor_config_<name> a valid field on all watch create/update API calls.
The fully merged spec is served live at /api/v1/full-spec.
See restock_diff/api.yaml for a working example.
Todo
- Make each processor return a extra list of sub-processed (so you could configure a single processor in different ways)
- move restock_diff to its own pip/github repo