Fixed Figma check (#1932)

Fixed cookies bug
Improved self-check mode: don't disable sites because of check errors
This commit is contained in:
Soxoj
2024-12-04 19:21:27 +01:00
committed by GitHub
parent e701c881a1
commit cb9f01c106
2 changed files with 14 additions and 5 deletions
+10 -3
View File
@@ -126,7 +126,8 @@ class SimpleAiohttpChecker(CheckerBase):
async with ClientSession( async with ClientSession(
connector=connector, connector=connector,
trust_env=True, trust_env=True,
cookie_jar=self.cookie_jar.copy() if self.cookie_jar else None, # TODO: tests
cookie_jar=self.cookie_jar if self.cookie_jar else None,
) as session: ) as session:
html_text, status_code, error = await self._make_request( html_text, status_code, error = await self._make_request(
session, session,
@@ -799,6 +800,7 @@ async def site_self_check(
proxy=None, proxy=None,
tor_proxy=None, tor_proxy=None,
i2p_proxy=None, i2p_proxy=None,
skip_errors=False,
): ):
changes = { changes = {
"disabled": False, "disabled": False,
@@ -850,8 +852,13 @@ async def site_self_check(
logger.warning( logger.warning(
f"Error while searching {username} in {site.name}: {result.context}, {msgs}, type {etype}" f"Error while searching {username} in {site.name}: {result.context}, {msgs}, type {etype}"
) )
# don't disable sites after the error
# meaning that the site could be available, but returned error for the check
# e.g. many sites protected by cloudflare and available in general
if skip_errors:
pass
# don't disable in case of available username # don't disable in case of available username
if status == QueryStatus.CLAIMED: elif status == QueryStatus.CLAIMED:
changes["disabled"] = True changes["disabled"] = True
elif status == QueryStatus.CLAIMED: elif status == QueryStatus.CLAIMED:
logger.warning( logger.warning(
@@ -904,7 +911,7 @@ async def self_check(
for _, site in all_sites.items(): for _, site in all_sites.items():
check_coro = site_self_check( check_coro = site_self_check(
site, logger, sem, db, silent, proxy, tor_proxy, i2p_proxy site, logger, sem, db, silent, proxy, tor_proxy, i2p_proxy, skip_errors=True
) )
future = asyncio.ensure_future(check_coro) future = asyncio.ensure_future(check_coro)
tasks.append(future) tasks.append(future)
+4 -2
View File
@@ -4960,6 +4960,9 @@
}, },
"Figma": { "Figma": {
"checkType": "message", "checkType": "message",
"headers": {
"User-Agent": "curl/8.6.0"
},
"presenceStrs": [ "presenceStrs": [
"twitter:title" "twitter:title"
], ],
@@ -4973,8 +4976,7 @@
"alexaRank": 240, "alexaRank": 240,
"tags": [ "tags": [
"design" "design"
], ]
"disabled": true
}, },
"8tracks.com": { "8tracks.com": {
"checkType": "message", "checkType": "message",