Skip to content

Commit d532fb6

Browse files
committed
fixed #55
1 parent 03c5543 commit d532fb6

File tree

4 files changed

+16
-37
lines changed

4 files changed

+16
-37
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434

3535
# 更新日志
3636

37+
## `v2.6.3`
38+
39+
- 修复下载页的 Cookie 验证问题[#55](https://github.com/zaxtyson/LanZouCloud-API/pull/55)
40+
3741
## `v2.6.2`
3842

3943
- 修复文件后缀非小写导致的误判问题[#92](https://github.com/rachpt/lanzou-gui/issues/92)

lanzou/api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from lanzou.api.core import LanZouCloud
22

3-
version = '2.6.2'
3+
version = '2.6.3'
44

55
__all__ = ['utils', 'types', 'models', 'LanZouCloud', 'version']

lanzou/api/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -433,12 +433,12 @@ def get_file_info_by_url(self, share_url, pwd='') -> FileDetail:
433433
if not first_page:
434434
return FileDetail(LanZouCloud.NETWORK_ERROR, pwd=pwd, url=share_url)
435435

436-
if "var arg1=" in first_page.text:
436+
if "acw_sc__v2" in first_page.text:
437437
# 在页面被过多访问或其他情况下,有时候会先返回一个加密的页面,其执行计算出一个acw_sc__v2后放入页面后再重新访问页面才能获得正常页面
438438
# 若该页面进行了js加密,则进行解密,计算acw_sc__v2,并加入cookie
439-
# 可以测试的链接:https://fzls.lanzous.com/iDBM7nbkzti ,使用隐私模式打开(确保无cookie),会注意到第一次访问时会返回形如下面这样的页面,会计算acw_sc__v2并设置cookie后reload,之后会返回正常的页面
440439
acw_sc__v2 = calc_acw_sc__v2(first_page.text)
441440
self._session.cookies.set("acw_sc__v2", acw_sc__v2)
441+
logger.debug(f"Set Cookie: acw_sc__v2={acw_sc__v2}")
442442
first_page = self._get(share_url) # 文件分享页面(第一页)
443443
if not first_page:
444444
return FileDetail(LanZouCloud.NETWORK_ERROR, pwd=pwd, url=share_url)

0 commit comments

Comments
 (0)