Update: CloudflareBypassForScraping

This commit is contained in:
Soxoj
2026-03-22 01:48:31 +01:00
parent a163278f89
commit 23c7757dcf
10 changed files with 120 additions and 52 deletions
+11 -2
View File
@@ -45,9 +45,9 @@ DEFAULT_ARGS: Dict[str, Any] = {
'web': None,
'with_domains': False,
'xmind': False,
# Mirrors maigret/resources/settings.json (flag --cloudflare-bypass overrides with True)
'cloudflare_bypass': {
"enabled": False,
"module": "cloudscraper",
"enabled": True,
"modules": [
{
"name": "chrome_webgate",
@@ -71,6 +71,15 @@ def test_args_search_mode(argparser):
assert getattr(args, arg) == want_args[arg]
def test_args_cloudflare_bypass_flag(argparser):
args = argparser.parse_args('--cloudflare-bypass username'.split())
want_args = dict(DEFAULT_ARGS)
want_args.update({'username': ['username'], 'cloudflare_bypass': True})
assert args == Namespace(**want_args)
def test_args_search_mode_several_usernames(argparser):
args = argparser.parse_args('username1 username2'.split())
+1 -1
View File
@@ -36,7 +36,7 @@ async def test_asyncio_progressbar_executor():
# no guarantees for the results order
assert sorted(await executor.run(tasks)) == [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
assert executor.execution_time > 0.2
assert executor.execution_time < 0.3
assert executor.execution_time < 0.6
@pytest.mark.asyncio