Commit Graph
25 Commits
Author SHA1 Message Date
Sushanth012andGitHub d8abe9554e fix: isolate per-site scan statistics (#3105) 2026-09-09 12:49:21 +03:00
Sushanth012andGitHub a2c964bfc2 Escape the dollar sign when building profile URL regexps (#3051) 2026-08-31 10:31:38 +02:00
jichaowang02-langandGitHub af253d7dc3 Make include-tag site filter case-insensitive (match exclude filter) (#2811)
In MaigretDatabase.ranked_sites_dict, the include (whitelist) tag filter
compared the site's raw tags against the lowercased query tags:

    is_tags_ok = lambda x: set(x.tags).intersection(set(normalized_tags))

while the exclude (blacklist) filter and every sibling lambda
(name/source/engine) lowercase the site-side value:

    is_excluded_by_tag = lambda x: set(map(str.lower, x.tags)).intersection(
        set(normalized_excluded_tags)
    )

So a site stored with an upper/mixed-case tag (e.g. a custom or submitted
site tagged 'US') was excluded by `--exclude-tags us` but NOT found by
`--tags us` — an asymmetry between the two filters. Lowercase the site
tags in the include filter too, matching the rest of the method.

Adds a regression test asserting tags=['us'] finds a site tagged 'US'.
2026-06-29 22:05:00 +02:00
jichaowang02-langandGitHub f8c35b09e3 Fix URLMatcher eating leading host chars (unescaped dots in prefix regex) (#2808)
URLMatcher._HTTP_URL_RE_STR was "^https?://(www.|m.)?(.+)$". The dots in
the optional (www.|m.)? subdomain-prefix group were unescaped, so each `.`
matched ANY character. For a host that simply starts with `m` or `www`
(not the literal `m.`/`www.` prefix), the group greedily ate the first
characters:

    extract_main_part('https://medium.com/alice')  -> 'dium.com/alice'
    extract_main_part('https://myspace.com/bob')   -> 'space.com/bob'

extract_main_part feeds make_profile_url_regexp / get_url_template, so the
generated site-detection regexp was corrupted too (medium.com -> dium.com),
and the loose prefix could match bogus hosts like `xmedium.com`. 170+ hosts
in resources/data.json start with `m`.

Fix: escape the dots with a raw string, r"^https?://(www\.|m\.)?(.+)$".
Genuine `m.`/`www.` prefixes are still stripped
(m.wikipedia.org -> wikipedia.org). The two existing tests that pinned the
unescaped pattern string are updated to the corrected form, and a
regression test covers hosts beginning with m/www.
2026-06-29 14:59:31 +02:00
AshvinandGitHub 4c938751ea fix: update_site() now replaces list element instead of local variable (#2751)
update_site() used `s = site` inside a for-loop, which rebinds only the
local loop variable and leaves self._sites[i] unchanged. The method
returned self silently appearing to succeed while the database list
retained the original entry. This broke --auto-disable for any site
already present in the database.

Fix with enumerate so the actual list element is replaced.

Fixes #2750
2026-06-10 20:05:18 +02:00
a85b0152fe Warn on engine dict merge conflicts (#2737)
Co-authored-by: pratyushjaiswal0806-dot <pratyushjaiswal0806@gmail.com>
2026-06-04 23:55:05 +02:00
egrezeliandGitHub 9dbefcef11 Fix ID extraction crash when regex groups are optional (#2572)
* Fix ID extraction crash when regex groups are optional

Handle None capture groups in username/id extraction and add regression coverage for optional trailing groups.

* Remove leftover line that overwrote safe _id in extract_id_from_url
2026-05-01 00:14:40 +02:00
SoxojandGitHub d136014576 Multiple lint and types fixes (#2454) 2026-04-02 21:01:49 +02:00
CopilotGitHubsoxojcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2e430e5039 feat: add tag blacklisting via --exclude-tags (#2352)
* Initial plan

* feat: add tag blacklisting support (--exclude-tags CLI flag, web UI, docs, tests)

Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com>
Agent-Logs-Url: https://github.com/soxoj/maigret/sessions/1a656af2-36bf-494f-9f03-1b5340f0357c

* fix: correct tag cloud label to match click-cycle interaction

Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com>
Agent-Logs-Url: https://github.com/soxoj/maigret/sessions/1a656af2-36bf-494f-9f03-1b5340f0357c

* feat: add all country tags to web interface tag cloud

Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com>
Agent-Logs-Url: https://github.com/soxoj/maigret/sessions/7e184b24-ff26-48fd-8a93-aea12b0a8d7b

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: soxoj <31013580+soxoj@users.noreply.github.com>
2026-03-24 22:00:59 +01:00
SoxojandGitHub 227a25bfa1 Twitter fixed, mirrors mechanism improvement (#2299) 2026-03-22 01:14:17 +01:00
SoxojandGitHub 4b1317789d Refactored self-check method, code formatting, small lint fixes (#1942) 2024-12-07 18:05:30 +01:00
SoxojandGitHub b370bc4c44 Sites checks fixes (#1896)
Fixed incorrect site names, added method to compare sites
2024-11-26 13:29:43 +01:00
SoxojandGitHub 5c05cfa5bc Fixed BongaCams, links parsing improved (#297)
* Fixed BongaCams, links parsing improved

* Fixed tests
2022-01-08 03:45:49 +03:00
Soxoj f81a500d72 Added cascade settings loading from ~/.maigret/settings.json and ./settings.json 2021-11-05 13:46:17 +03:00
Soxoj 9b0acc092a Refactoring of submit module, some fixes 2021-06-13 00:43:28 +03:00
Soxoj b696b982f4 Added some photo sites, improved errors detecting 2021-05-08 20:37:34 +03:00
Soxoj 5ee91f6659 Introduced --retries flag, made thorough refactoring
- updated sites list
- test scripts linting
2021-05-01 23:54:01 +03:00
Soxoj 908176be85 Reformat code, some sites added 2021-03-19 01:48:20 +03:00
Soxoj c0956a0e23 Improved extraction of usernames from links in personal data 2021-02-15 01:36:10 +03:00
Soxoj b4fb100387 Improved sites list filtering, pretty messages 2021-02-06 18:14:36 +03:00
Soxoj d1f7343832 Tags and custom checks bugfixes 2021-01-16 14:25:13 +03:00
Soxoj 47cf6f4d81 Self-checking mode fixed, tags/names site filtering & ranking 2021-01-11 21:42:24 +03:00
Soxoj e4765d1ed9 HTLM reports draft, 500 sites scanning by default 2021-01-07 23:52:29 +03:00
Soxoj d389ba9e76 Refactoring: updated data & sites storing, tests added 2021-01-03 23:48:33 +03:00
Soxoj 315ecec39f Refactoring, sites database tests 2021-01-02 00:23:58 +03:00