Commit Graph
22 Commits
Author SHA1 Message Date
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
jichaowang02-langandGitHub ac25cd71bb Fix get_dict_ascii_tree ignoring new_line=False (#2805)
`get_dict_ascii_tree(items, prepend="", new_line=True)` immediately reassigned
`new_line` to the horizontal box-drawing glyph ("─"), shadowing the boolean
parameter. The trailing `if not new_line: text = text[1:]` — meant to strip the
leading newline — therefore tested a non-empty string (always truthy) and never
ran. Callers passing `new_line=False` (e.g. `maigret.py` printing a user's
identity data) got a stray leading blank line.

Rename the glyph local to `h_line` so the `new_line` parameter is preserved and
its strip takes effect. The tree drawing is unchanged.

Adds a regression test asserting `new_line=False` drops the leading newline
while keeping the rest of the tree identical.
2026-06-28 20:11:46 +02:00
SoxojandGitHub f2e4f8d3a2 Merge commit from fork 2026-06-17 15:15:32 +02:00
AshvinandGitHub 0e9ced3168 fix: pass value v not key k to is_country_tag in generate_report_context (#2753)
is_country_tag checks for a 2-letter alpha code. The field names
'country' and 'locale' are 6-7 characters and never match, so the
direct alpha_2 lookup branch was dead code and all country values fell
through to search_fuzzy unconditionally.

Change is_country_tag(k) -> is_country_tag(v) so that 2-letter ISO
codes (e.g. 'US', 'RU') use the fast direct lookup while full country
names continue to use fuzzy search.

Fixes #2752
2026-06-11 14:48:21 +02:00
SoxojandGitHub 51a5169987 fix(checking): reject URLs and emails extracted as usernames (#2673)
Closes #1403
2026-05-16 17:52:00 +02:00
SoxojandGitHub 4b1317789d Refactored self-check method, code formatting, small lint fixes (#1942) 2024-12-07 18:05:30 +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
soxojandGitHub 7decbce08d Box drawing logic improved, added new settings (#217) 2021-11-09 02:33:31 +03:00
Soxoj 516861e0ae Some security fixes
Added link to Patreon
2021-10-31 22:41:59 +03:00
Soxoj 9b0acc092a Refactoring of submit module, some fixes 2021-06-13 00:43:28 +03:00
Soxoj 2c04ccce57 Improved tests 2021-05-18 00:43:56 +03:00
Soxoj 0e9655c46a Improve extracting ids from URLs, tests 2021-05-06 22:35:44 +03:00
Soxoj 3b91a9cd31 CLI arguments improvements, tests added 2021-05-05 15:27:56 +03:00
Soxoj 66d6c7a93c Added some new sites, engines updates 2021-05-03 03:16:02 +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 2741680d4a Fixed bug with ignore403 for engine-based sites 2021-03-28 17:37:18 +03:00
Soxoj a2ddb15f09 Improving "parse" mode for extracting usernames and other info for a further search 2021-03-21 18:34:57 +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 e4765d1ed9 HTLM reports draft, 500 sites scanning by default 2021-01-07 23:52:29 +03:00
Soxoj 5c8b65d033 Reports refactoring & tests 2021-01-06 10:53:23 +03:00
Soxoj d389ba9e76 Refactoring: updated data & sites storing, tests added 2021-01-03 23:48:33 +03:00