Skip to content

Commit

Permalink
support reading cookie from browser
Browse files Browse the repository at this point in the history
  • Loading branch information
zaxtyson committed Mar 6, 2021
1 parent 39c1a0a commit 5c10982
Show file tree
Hide file tree
Showing 6 changed files with 790 additions and 12 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
# 关于 Cookie

- 由于 Web 和 App 端均被加上了滑动验证, CMD 不便绕过, 故使用 Cookie 登录
- 一般情况下, 程序能够自动读取浏览器的 Cookie, 完成登录, 如果有问题可手工输入
- Cookie 内容见浏览器地址栏前的🔒 (Chrome/Microsoft Edge)
- `woozooo.com` -> `Cookie` -> `ylogin` -> `内容`
- `pc.woozooo.com` -> `Cookie` -> `phpdisk_info` -> `内容`
Expand Down Expand Up @@ -102,6 +103,10 @@

# 更新日志

## `v2.6.2`

- 支持登录时自动读取浏览器 Cookie[#59](https://github.com/zaxtyson/LanZouCloud-CMD/issues/59)

## `v2.6.1`

- 修复下载某些 txt 文件失败的问题[#53](https://github.com/zaxtyson/LanZouCloud-API/issues/53)
Expand Down
2 changes: 2 additions & 0 deletions lanzou/api/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def login_by_cookie(self, cookie: dict) -> int:

def logout(self) -> int:
"""注销"""
self._cookies = None
self._session.cookies.clear()
html = self._get(self._account_url, params={'action': 'logout'})
if not html:
return LanZouCloud.NETWORK_ERROR
Expand Down
2 changes: 1 addition & 1 deletion lanzou/cmder/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from lanzou.cmder.config import config

version = '2.6.1'
version = '2.6.2'

__all__ = ['cmder', 'utils', 'version', 'config']
Loading

0 comments on commit 5c10982

Please sign in to comment.