diff --git a/maigret/resources/data.json b/maigret/resources/data.json index 94d4931..188fdd4 100644 --- a/maigret/resources/data.json +++ b/maigret/resources/data.json @@ -2144,11 +2144,17 @@ "cz", "webcam" ], - "checkType": "status_code", + "absenceStrs": [ + "Informa\u00e7\u00e3o e p\u00e1gina" + ], + "checkType": "message", "alexaRank": 30, "urlMain": "https://pt.bongacams.com", "url": "https://pt.bongacams.com/profile/{username}", - "usernameClaimed": "asuna-black", + "usernameClaimed": "Icehotangel", "usernameUnclaimed": "noonewouldeverusethis77777" }, "Bookandreader": { @@ -13126,7 +13132,7 @@ "checkType": "response_url", "alexaRank": 82345, "urlMain": "http://sprashivai.ru", - "url": "http://sprashivai.ru/{username}?sl", + "url": "http://sprashivai.ru/{username}", "usernameClaimed": "red", "usernameUnclaimed": "noonewouldeverusethis7" }, diff --git a/maigret/utils.py b/maigret/utils.py index ab414a0..8367c55 100644 --- a/maigret/utils.py +++ b/maigret/utils.py @@ -42,7 +42,7 @@ def enrich_link_str(link: str) -> str: class URLMatcher: - _HTTP_URL_RE_STR = "^https?://(www.)?(.+)$" + _HTTP_URL_RE_STR = "^https?://(www.|m.)?(.+)$" HTTP_URL_RE = re.compile(_HTTP_URL_RE_STR) UNSAFE_SYMBOLS = ".?" @@ -66,7 +66,7 @@ class URLMatcher: ) regexp_str = self._HTTP_URL_RE_STR.replace("(.+)", url_regexp) - return re.compile(regexp_str) + return re.compile(regexp_str, re.IGNORECASE) def ascii_data_display(data: str) -> Any: diff --git a/tests/test_sites.py b/tests/test_sites.py index 23610c6..f0a4092 100644 --- a/tests/test_sites.py +++ b/tests/test_sites.py @@ -115,7 +115,7 @@ def test_site_url_detector(): assert ( db.sites[0].url_regexp.pattern - == r'^https?://(www.)?forum\.amperka\.ru/members/\?username=(.+?)$' + == r'^https?://(www.|m.)?forum\.amperka\.ru/members/\?username=(.+?)$' ) assert ( db.sites[0].detect_username('http://forum.amperka.ru/members/?username=test') diff --git a/tests/test_utils.py b/tests/test_utils.py index 951fe9f..171cce7 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -98,7 +98,7 @@ def test_url_make_profile_url_regexp(): # ensure all combinations match pattern assert ( URLMatcher.make_profile_url_regexp(url).pattern - == r'^https?://(www.)?flickr\.com/photos/(.+?)$' + == r'^https?://(www.|m.)?flickr\.com/photos/(.+?)$' )