Merge branch 'main' into main

This commit is contained in:
程序员阿江-Relakkes
2024-06-12 21:53:41 +08:00
committed by GitHub
20 changed files with 180 additions and 151 deletions

View File

@@ -1,3 +1,4 @@
import argparse
import logging
from .crawler_util import *
@@ -18,3 +19,13 @@ def init_loging_config():
logger = init_loging_config()
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')