alist icon indicating copy to clipboard operation
alist copied to clipboard

蓝奏云预览&下载文件时 500 错误

Open XcantloadX opened this issue 1 year ago • 2 comments

Please make sure of the following things

  • [X] I have read the documentation.
  • [X] I'm sure there are no duplicate issues or discussions.
  • [ ] I'm sure it's due to alist and not something else(such as Dependencies or Operational).

Alist Version / Alist 版本

v2.6.3

Driver used / 使用的存储驱动

蓝奏云

Describe the bug / 问题描述

如题
url 和 cookie 模式都测试过,代理开不开都一样,全部报同一个错误

Reproduction / 复现链接

https://wwi.lanzoup.com/b02bvg26j 密码:2y18

Logs / 日志

[GIN] 2022/08/01 - 19:32:30 | 500 |    1.0803104s |       127.0.0.1 | GET      "/d/test/pre-release.apk"
[GIN] 2022/08/01 - 19:33:48 | 207 |            0s |       127.0.0.1 | PROPFIND  "/dav/"
[GIN] 2022/08/01 - 19:33:48 | 207 |         305µs |       127.0.0.1 | PROPFIND  "/dav/Lanzou/"
[GIN] 2022/08/01 - 19:33:48 | 207 |            0s |       127.0.0.1 | PROPFIND  "/dav/Lanzou/UnitaleX/"
[GIN] 2022/08/01 - 19:34:09 | 200 |            0s |       127.0.0.1 | GET      "/test/pre-release.apk"
[GIN] 2022/08/01 - 19:34:10 | 200 |            0s |       127.0.0.1 | GET      "/api/admin/login"
[GIN] 2022/08/01 - 19:34:10 | 200 |       504.1µs |       127.0.0.1 | GET      "/api/public/settings"
[GIN] 2022/08/01 - 19:34:10 | 200 |      1.0239ms |       127.0.0.1 | GET      "/api/admin/settings?group=1"
[GIN] 2022/08/01 - 19:34:10 | 200 |       832.5µs |       127.0.0.1 | POST     "/api/public/path"


2022/08/01 19:34:13 [Recovery] 2022/08/01 - 19:34:13 panic recovered:
runtime error: index out of range [1] with length 0
/usr/local/go/src/runtime/panic.go:89 (0xd1855e)
/source/drivers/lanzou/lanzou.go:213 (0x1689d33)
/source/drivers/lanzou/driver.go:139 (0x16857d8)
/source/server/controllers/proxy.go:58 (0x1809b55)
/source/server/controllers/down.go:22 (0x18071c4)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x180cbb2)
/source/server/middlewares/down.go:26 (0x180cace)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x17fb681)
/go/pkg/mod/github.com/gin-gonic/[email protected]/recovery.go:99 (0x17fb66c)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x17fa7a6)
/go/pkg/mod/github.com/gin-gonic/[email protected]/logger.go:241 (0x17fa789)
/go/pkg/mod/github.com/gin-gonic/[email protected]/context.go:165 (0x17f989d)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:489 (0x17f9525)
/go/pkg/mod/github.com/gin-gonic/[email protected]/gin.go:445 (0x17f9084)
/usr/local/go/src/net/http/server.go:2916 (0xfc47da)
/usr/local/go/src/net/http/server.go:1966 (0xfbf7d6)
/usr/local/go/src/runtime/asm_amd64.s:1571 (0xd4b9c0)

[GIN] 2022/08/01 - 19:34:13 | 500 |    393.1675ms |       127.0.0.1 | GET      "/d/test/pre-release.apk"

XcantloadX avatar Aug 01 '22 11:08 XcantloadX

Thanks for opening your first issue here! Be sure to follow the issue template!

welcome[bot] avatar Aug 01 '22 11:08 welcome[bot]

是这里的正则出了错 https://github.com/alist-org/alist/blob/5e59b0a697e3b65df151104e8f4f8c07b25e29b5/drivers/lanzou/lanzou.go#L213

蓝奏云的网页源码又改了:


<script type="text/javascript">
		var ajaxdata = '?ctdf';
		var cwebsignkeyc = '66xM';
		var awebsigna = '';
		var vsign = 'AmRTbQw9UmNSWws0UGAHOwdqUmBXOAMzUWIENgFsADQCJFZ1C2sPalU1AWJQPVJmWjhUZF80Vm0LOg_c_c';
		//var ispostdowns = '';
		$.ajax({
			type : 'post',
			url : '/ajaxm.php',
			//data : { 'action':'downprocess','signs':ajaxdata,'sign':'sign','ves':1,'websign':websign,'websignkey':websignkey },
			data : { 'action':'downprocess','signs':ajaxdata,'sign':vsign,'websign':awebsigna,'websignkey':cwebsignkeyc,'ves':1 },
			dataType : 'json',
			success:function(msg){
				var date = msg;
				if(date.zt == '1'){
										$("#go").html("<a href="+date.dom+"/file/"+ date.url +" target=_blank rel=noreferrer><span class=txt>电信下载</span><span class='txt txtc'>联通下载</span><span class=txt>普通下载</span></a>");
					setTimeout('$("#outime").css("display","block");',1800000);
									}else{
					$("#go").html("网页超时,请刷新");
				};
				
			},
			error:function(){
				$("#go").html("获取失败,请刷新");
			}
	
		});
</script>

应该把websignkey改成cwebsignkeyc就行

XcantloadX avatar Aug 04 '22 05:08 XcantloadX