mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-10-07 22:38:11 +08:00
improve base config reading command line arg logic
This commit is contained in:
@@ -24,7 +24,7 @@ class WeiboLogin(AbstractLogin):
|
||||
login_phone: Optional[str] = "",
|
||||
cookie_str: str = ""
|
||||
):
|
||||
self.login_type = login_type
|
||||
config.LOGIN_TYPE = login_type
|
||||
self.browser_context = browser_context
|
||||
self.context_page = context_page
|
||||
self.login_phone = login_phone
|
||||
@@ -33,11 +33,11 @@ class WeiboLogin(AbstractLogin):
|
||||
async def begin(self):
|
||||
"""Start login weibo"""
|
||||
utils.logger.info("[WeiboLogin.begin] Begin login weibo ...")
|
||||
if self.login_type == "qrcode":
|
||||
if config.LOGIN_TYPE == "qrcode":
|
||||
await self.login_by_qrcode()
|
||||
elif self.login_type == "phone":
|
||||
elif config.LOGIN_TYPE == "phone":
|
||||
await self.login_by_mobile()
|
||||
elif self.login_type == "cookie":
|
||||
elif config.LOGIN_TYPE == "cookie":
|
||||
await self.login_by_cookies()
|
||||
else:
|
||||
raise ValueError(
|
||||
|
||||
Reference in New Issue
Block a user