mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-03-18 17:27:33 +08:00
add few arg cmds
This commit is contained in:
@@ -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.')
|
||||
|
||||
Reference in New Issue
Block a user