Repository: AlistGo/alist (language: go)

Issue:
蓝奏云下载页面仍然报failed link: failed get link
### Please make sure of the following things

- [X] I have read the [documentation](https://alist.nn.ci).
我已经阅读了[文档](https://alist.nn.ci)。

- [X] I'm sure there are no duplicate issues or discussions.
我确定没有重复的issue或讨论。

- [X] I'm sure it's due to `AList` and not something else(such as [Network](https://alist.nn.ci/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host) ,`Dependencies` or `Operational`).
我确定是`AList`的问题，而不是其他原因（例如[网络](https://alist.nn.ci/zh/faq/howto.html#tls-handshake-timeout-read-connection-reset-by-peer-dns-lookup-failed-connect-connection-refused-client-timeout-exceeded-while-awaiting-headers-no-such-host)，`依赖`或`操作`）。

- [X] I'm sure this issue is not fixed in the latest version.
我确定这个问题在最新版本中没有被修复。


### AList Version / AList 版本

3.37.3

### Driver used / 使用的存储驱动

蓝奏云

### Describe the bug / 问题描述

点击蓝奏云中任意文件，下载页加载缓慢，然后提示如下错误：
![image](https://github.com/user-attachments/assets/ef324863-725d-4f36-8946-e4474052a800)
但是复制图中报错的链接直接下载却是可以正常下载的。

### Reproduction / 复现链接

我使用私有配置，难以对外提供链接，如果debug必须，请告知我。

### Config / 配置

![image](https://github.com/user-attachments/assets/8ca89c99-30b2-4645-ad24-ccad84bd5d0e)


### Logs / 日志

<details>
  <summary>点击展开</summary>

```
[GIN] 2024/09/18 - 10:50:43 | 200 | 30.494926685s |   112.21.48.119 | POST     "/api/fs/get"
[GIN] 2024/09/18 - 10:53:12 | 200 |     146.357µs |   112.21.48.119 | GET      "/Jennings蓝奏云/1.ppt"
[GIN] 2024/09/18 - 10:53:12 | 200 |     235.919µs |   112.21.48.119 | GET      "/api/public/settings"
[GIN] 2024/09/18 - 10:53:12 | 200 |     185.779µs |   112.21.48.119 | GET      "/api/me"
[GIN] 2024/09/18 - 10:53:12 | 200 |      64.801µs |   112.21.48.119 | GET      "/api/public/offline_download_tools"
ERRO[2024-09-18 10:53:43] failed link /Jennings蓝奏云/1.ppt: Get "http://develope-oss.lanzouc.com/file/?B2FUa(***隐去***)BzNWaQM1": dial tcp [240e:5a:2003:3131::41]:80: i/o timeout
failed get link
github.com/alist-org/alist/v3/internal/op.Link.func1
        /source/internal/op/fs.go:260
github.com/alist-org/alist/v3/pkg/singleflight.(*Group[...]).doCall.func2
        /source/pkg/singleflight/singleflight.go:193
github.com/alist-org/alist/v3/pkg/singleflight.(*Group[...]).doCall
        /source/pkg/singleflight/singleflight.go:195
github.com/alist-org/alist/v3/pkg/singleflight.(*Group[...]).Do
        /source/pkg/singleflight/singleflight.go:108
github.com/alist-org/alist/v3/internal/op.Link
        /source/internal/op/fs.go:276
github.com/alist-org/alist/v3/internal/fs.link
        /source/internal/fs/link.go:19
github.com/alist-org/alist/v3/internal/fs.Link
        /source/internal/fs/fs.go:48
github.com/alist-org/alist/v3/server/handles.FsGet
        /source/server/handles/fsread.go:305
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.Auth
        /source/server/middlewares/auth.go:73
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/alist-org/alist/v3/server/middlewares.StoragesLoaded
        /source/server/middlewares/check.go:14
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.CustomRecoveryWithWriter.func1
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/recovery.go:102
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.LoggerWithConfig.func1
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/logger.go:249
github.com/gin-gonic/gin.(*Context).Next
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/context.go:185
github.com/gin-gonic/gin.(*Engine).handleHTTPRequest
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:633
github.com/gin-gonic/gin.(*Engine).ServeHTTP
        /go/pkg/mod/github.com/gin-gonic/gin@v1.10.0/gin.go:589
net/http.serverHandler.ServeHTTP
        /usr/local/go/src/net/http/server.go:3210
net/http.(*conn).serve
        /usr/local/go/src/net/http/server.go:2092
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1700
failed link
[GIN] 2024/09/18 - 10:53:43 | 200 | 30.493846295s |   112.21.48.119 | POST     "/api/fs/get"
```

</details>


Discussion / hints:
### See
1. 68% #3613
2. 63% #2133
3. 60% #3376
4. 54% #4529
5. 53% #3438

<!-- Created by actions-cool/issues-similarity-analysis. Do not remove. -->
换个分享链接就行
> 换个分享链接就行

您是说后台设置中的“分享链接”字段吗？我使用了官方文档内建议的`https://wwop.lanzoul.com`可是报错。请问应该换成哪个呢？
> > 换个分享链接就行
> 
> 您是说后台设置中的“分享链接”字段吗？我使用了官方文档内建议的`https://wwop.lanzoul.com`可是报错。请问应该换成哪个呢？

还有ua
> > > 换个分享链接就行
> > 
> > 
> > 您是说后台设置中的“分享链接”字段吗？我使用了官方文档内建议的`https://wwop.lanzoul.com`可是报错。请问应该换成哪个呢？
> 
> 还有ua

请问应该使用什么UA呢？我在手册里没有找到描述：https://alist.nn.ci/zh/guide/drivers/lanzou.html#%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF
> > > > 换个分享链接就行
> > > 
> > > 
> > > 您是说后台设置中的“分享链接”字段吗？我使用了官方文档内建议的`https://wwop.lanzoul.com`可是报错。请问应该换成哪个呢？
> > 
> > 
> > 还有ua
> 
> 请问应该使用什么UA呢？我在手册里没有找到描述：https://alist.nn.ci/zh/guide/drivers/lanzou.html#%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF

![Screenshot_20240918-124522-564](https://github.com/user-attachments/assets/084fb22c-ded2-4969-b0fa-3ad63712f167)

<details>

> > > > > 换个分享链接就行
> > > > 
> > > > 
> > > > 您是说后台设置中的“分享链接”字段吗？我使用了官方文档内建议的`https://wwop.lanzoul.com`可是报错。请问应该换成哪个呢？
> > > 
> > > 
> > > 还有ua
> > 
> > 
> > 请问应该使用什么UA呢？我在手册里没有找到描述：https://alist.nn.ci/zh/guide/drivers/lanzou.html#%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF
> 
> ![Screenshot_20240918-124522-564](https://private-user-images.githubusercontent.com/24273319/368423554-084fb22c-ded2-4969-b0fa-3ad63712f167.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjY2MzY2NTAsIm5iZiI6MTcyNjYzNjM1MCwicGF0aCI6Ii8yNDI3MzMxOS8zNjg0MjM1NTQtMDg0ZmIyMmMtZGVkMi00OTY5LWIwZmEtM2FkNjM3MTJmMTY3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTE4VDA1MTIzMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTkwNmVjYzg2YWZjZjRhZjBhYjNjNTRkMmEwYzkwYWI1NTRkZWY3MTUwN2JkMzk4YWY3NzhjM2RjZjRkNDc1OWMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.C-H0ji9WmMkir4tYja1vCMGXxXMYG1oPSAwmJBeHThc)

</details>

不好意思啊，您的截图好像没有截全，我尝试了把蓝奏的三级域名换成您截图中的样式，并且使用如下UA:`Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`可是症状依旧...
> 不好意思啊，您的截图好像没有截全，我尝试了把蓝奏的三级域名换成您截图中的样式，并且使用如下UA:`Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`可是症状依旧...

开web代理
> > 不好意思啊，您的截图好像没有截全，我尝试了把蓝奏的三级域名换成您截图中的样式，并且使用如下UA:`Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`可是症状依旧...
> 
> 开web代理

感谢您耐心的回复，但是我在问问题前已经把所有web UI中能够排列组合的设置全部试过了，都无效才问的。打开web代理后下载页能够显示，点击下载按钮后转圈，最后然后以plain text的形式返回了相同的错误。
> > > 不好意思啊，您的截图好像没有截全，我尝试了把蓝奏的三级域名换成您截图中的样式，并且使用如下UA:`Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`可是症状依旧...
> > 
> > 
> > 开web代理
> 
> 感谢您耐心的回复，但是我在问问题前已经把所有web UI中能够排列组合的设置全部试过了，都无效才问的。打开web代理后下载页能够显示，点击下载按钮后转圈，最后然后以plain text的形式返回了相同的错误。

你把设备的ipv6关掉呢
> > > > 不好意思啊，您的截图好像没有截全，我尝试了把蓝奏的三级域名换成您截图中的样式，并且使用如下UA:`Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`可是症状依旧...
> > > 
> > > 
> > > 开web代理
> > 
> > 
> > 感谢您耐心的回复，但是我在问问题前已经把所有web UI中能够排列组合的设置全部试过了，都无效才问的。打开web代理后下载页能够显示，点击下载按钮后转圈，最后然后以plain text的形式返回了相同的错误。
> 
> 你把设备的ipv6关掉呢

谢谢您，但是好像还是无效...我用手机等其他设备也试过，错误依旧。
![image](https://github.com/user-attachments/assets/7dab6321-ed01-4791-8a10-2772a49d4274)


Fix patch:
diff --git a/drivers/lanzou/help.go b/drivers/lanzou/help.go
index 31a558e9c75..81d7c567d5c 100644
--- a/drivers/lanzou/help.go
+++ b/drivers/lanzou/help.go
@@ -120,9 +120,9 @@ var findKVReg = regexp.MustCompile(`'(.+?)':('?([^' },]*)'?)`) // 拆分kv
 func findJSVarFunc(key, data string) string {
 	var values []string
 	if key != "sasign" {
-		values = regexp.MustCompile(`var ` + key + ` = '(.+?)';`).FindStringSubmatch(data)
+		values = regexp.MustCompile(`var ` + key + `\s*=\s*['"]?(.+?)['"]?;`).FindStringSubmatch(data)
 	} else {
-		matches := regexp.MustCompile(`var `+key+` = '(.+?)';`).FindAllStringSubmatch(data, -1)
+		matches := regexp.MustCompile(`var `+key+`\s*=\s*['"]?(.+?)['"]?;`).FindAllStringSubmatch(data, -1)
 		if len(matches) == 3 {
 			values = matches[1]
 		} else {
diff --git a/drivers/lanzou/util.go b/drivers/lanzou/util.go
index abc2c400119..4b9959ad53d 100644
--- a/drivers/lanzou/util.go
+++ b/drivers/lanzou/util.go
@@ -264,6 +264,9 @@ var findSubFolderReg = regexp.MustCompile(`(?i)(?:folderlink|mbxfolder).+href="/
 // 获取下载页面链接
 var findDownPageParamReg = regexp.MustCompile(`<iframe.*?src="(.+?)"`)
 
+// 获取文件ID
+var findFileIDReg = regexp.MustCompile(`'/ajaxm\.php\?file=(\d+)'`)
+
 // 获取分享链接主界面
 func (d *LanZou) getShareUrlHtml(shareID string) (string, error) {
 	var vs string
@@ -356,8 +359,16 @@ func (d *LanZou) getFilesByShareUrl(shareID, pwd string, sharePageData string) (
 			return nil, err
 		}
 		param["p"] = pwd
+
+		fileIDs := findFileIDReg.FindStringSubmatch(sharePageData)
+		var fileID string
+		if len(fileIDs) > 1 {
+			fileID = fileIDs[1]
+		} else {
+			return nil, fmt.Errorf("not find file id")
+		}
 		var resp FileShareInfoAndUrlResp[string]
-		_, err = d.post(d.ShareUrl+"/ajaxm.php", func(req *resty.Request) { req.SetFormData(param) }, &resp)
+		_, err = d.post(d.ShareUrl+"/ajaxm.php?file="+fileID, func(req *resty.Request) { req.SetFormData(param) }, &resp)
 		if err != nil {
 			return nil, err
 		}
@@ -381,8 +392,15 @@ func (d *LanZou) getFilesByShareUrl(shareID, pwd string, sharePageData string) (
 			return nil, err
 		}
 
+		fileIDs := findFileIDReg.FindStringSubmatch(nextPageData)
+		var fileID string
+		if len(fileIDs) > 1 {
+			fileID = fileIDs[1]
+		} else {
+			return nil, fmt.Errorf("not find file id")
+		}
 		var resp FileShareInfoAndUrlResp[int]
-		_, err = d.post(d.ShareUrl+"/ajaxm.php", func(req *resty.Request) { req.SetFormData(param) }, &resp)
+		_, err = d.post(d.ShareUrl+"/ajaxm.php?file="+fileID, func(req *resty.Request) { req.SetFormData(param) }, &resp)
 		if err != nil {
 			return nil, err
 		}


Test patch: