mirror of
https://github.com/NanmiCoder/MediaCrawler.git
synced 2026-10-08 14:48:12 +08:00
improve base config reading command line arg logic
This commit is contained in:
@@ -23,7 +23,7 @@ class DouYinLogin(AbstractLogin):
|
||||
login_phone: Optional[str] = "",
|
||||
cookie_str: Optional[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
|
||||
@@ -40,11 +40,11 @@ class DouYinLogin(AbstractLogin):
|
||||
await self.popup_login_dialog()
|
||||
|
||||
# select login type
|
||||
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("[DouYinLogin.begin] Invalid Login Type Currently only supported qrcode or phone or cookie ...")
|
||||
|
||||
Reference in New Issue
Block a user