Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_file_info_by_url方法失效,导致无法下载及临时解决办法 #74

Closed
nhnhwsnh opened this issue Mar 30, 2022 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@nhnhwsnh
Copy link

问题描述:down_dir_by_url, down_file_by_url等下载方法均失效
解决思路:

手动请求了https://wwu.lanzoui.com/fn?UzVa.......mB 地址后,服务器返回内容如下

		var ajaxdata = 'xxx';
		//var ispostdowns = '';
		var websignkey = 'xxxx';
		var websign = '2';
		$.ajax({
			type : 'post',
			url : '/ajaxm.php',
			data : { 'action':'downprocess','signs':ajaxdata,'sign':'xxxxxxxxxxxxxxxxxxxxxxxAJpU2BXZg_c_c','ves':1,'websign':websign,'websignkey':websignkey },
			//data : { 'action':'downprocess','sign':sign,'sign':sign,'ves':1},
			dataType : 'json',
			success:function(msg){
......

定位到 .........\site-packages\lanzou\api\core.py的get_file_info_by_url方法,修改相应代码

在514行后,插入如下内容

ajaxdata = re.search(r"var ajaxdata\s*=\s*'(.+?)';", first_page).group(1)
websign = re.search(r"var websign\s*=\s*'(.+?)';", first_page).group(1)
websignkey = re.search(r"var websignkey\s*=\s*'(.+?)';", first_page).group(1)
post_data = {'action': 'downprocess', 'signs': ajaxdata, 'sign': sign, 'ves': 1, 'websign': websign,
             'websignkey': websignkey}

结果:截止提交issue时,修改过的代码,可以下载~

@nhnhwsnh nhnhwsnh changed the title get_file_info_by_url方法失效,导致无法下载 get_file_info_by_url方法失效,导致无法下载及临时解决办法 Mar 30, 2022
@zaxtyson
Copy link
Owner

能给一些测试用的文件链接么,我测试了几个链接和文件夹,似乎都下载成功了,没法复现🤔。
在我测试文件链接中,first_page 页面并没有出现 var websign ,可能是官方加了什么验证,达到什么条件才能触发

@nhnhwsnh
Copy link
Author

https://wwu.lanzoui.com/b030us25e密码cfr3

目前,我这边下载的内容多是txt小说,基本都有websign的(大于90%)

您说的,可能是在某些条件下触发的

@nhnhwsnh
Copy link
Author

nhnhwsnh commented Mar 30, 2022 via email

zaxtyson added a commit that referenced this issue Apr 2, 2022
@zaxtyson
Copy link
Owner

zaxtyson commented Apr 2, 2022

确实URL不一样,后面跟了一个 webpage 参数: https://pan.lanzouo.com/ipy3f01xq1da?webpage=U2IHZlw1DmIIZgNtBWZdals4BjADIFRgATNSYF01BDMBNgVrWjcAKFI1
去掉这个参数就需要密码,而且链接有时效性,不知道官方又在搞什么🤷‍♂️

@zaxtyson zaxtyson added the bug Something isn't working label Apr 2, 2022
zaxtyson added a commit that referenced this issue Apr 2, 2022
zaxtyson added a commit to zaxtyson/LanZouCloud-CMD that referenced this issue Apr 2, 2022
zaxtyson added a commit to zaxtyson/LanZouCloud-CMD that referenced this issue Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants