diff --git a/requirements.txt b/requirements.txt index 8530e87..11d01fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,4 @@ lxml==4.9.1 requests==2.32.0 tqdm==4.66.3 absl-py==0.12.0 -git+https://github.com/borisbabic/browser_cookie3.git@refs/pull/215/head \ No newline at end of file +browser_cookie3==0.20.1 diff --git a/weibo_spider/config_util.py b/weibo_spider/config_util.py index 27f4eeb..f5dc682 100644 --- a/weibo_spider/config_util.py +++ b/weibo_spider/config_util.py @@ -207,7 +207,7 @@ def check_cookie(user_config_file_path): """Checks if user is logged in""" try: cookie = get_cookie() - if cookie["MLOGIN"] == '0': + if cookie.get("MLOGIN", '0') == '0': logger.warning("使用 Chrome 在此登录 %s", "https://passport.weibo.com/sso/signin?entry=wapsso&source=wapssowb&url=https://m.weibo.cn/") sys.exit() else: