kuoruan/dmhy-download-helper

列表页下载 torrent 文件提示“下载失败,请重试”

Closed this issue · 3 comments

chrome版本:114.0.5735.134(正式版本) (64 位)
Tampermonkey版本:4.19.0
控制台报错:
injected: Refused to connect to "https:///2023/06/22/4b5b947ab3bcc89253c376ab83278e18e26188fc.torrent": This domain is not a part of the @connect list

尝试换用Edge,一切正常,不能复现此问题。

我这边也无法复现

我这边也无法复现

Windows 10 22H2 成功复现

Microsoft Edge
版本 114.0.1823.67 (正式版本) (64 位)

Tampermonkey
版本 4.19.0

injected: Refused to connect to "https:///2023/07/02/0319fb3a460bb0c07ea9a1938ee62b134235d1df.torrent": This domain is not a part of the @connect list

这个链接点进去会变成:
https://0.0.7.231/07/02/0319fb3a460bb0c07ea9a1938ee62b134235d1df.torrent

我这边也无法复现

确实可以复现这个问题,我的控制台报错 content.js:8 injected: Refused to connect to "https:///2023/11/24/b9db6f5317032263ce936e5861cc5f0ab675dc67.torrent": This domain is not a part of the @connect list
发现问题是 downloadTorrent: function(url, name) 中的 url 错误,应该是前面 getAndDownloadTorrent 中的问题。

responseText && (matches = responseText.match(/<a href="((?:https?)?\/\/dl\.dmhy\.org\/[^"]+\.torrent)">(.+)?<\/a>/)) && matches.length >= 3 ? _self.downloadTorrent(matches[1], "".concat(matches[2] || title, ".torrent")) : _self.$toast.display("获取下载链接失败!");

没学过js,问chatgpt给出一个解决方案是把上面出问题的哪一行 downloadTorrent(url, name) 函数url中强制添加 dl.dmhy.org (*´д`)

responseText && (matches = responseText.match(/<a href="((?:https?)?\/\/dl\.dmhy\.org\/[^"]+\.torrent)">(.+)?<\/a>/)) && matches.length >= 3 ? _self.downloadTorrent(matches[1].startsWith('http') ? matches[1] : 'https://dl.dmhy.org' + matches[1], "".concat(matches[2] || title, ".torrent")) : _self.$toast.display("获取下载链接失败!");

update: 测试修改完确实能下torrent文件,但是torrent文件是无效的,无法添加到bt软件中。。。