From e8cad7072d9816040a4b0b1bef441d6fbc3f547a Mon Sep 17 00:00:00 2001 From: Xingwang Liao Date: Mon, 25 Dec 2023 04:55:23 +0000 Subject: [PATCH] fix: torrent download failed fix #205 --- src/components/TorrentDownloadItem.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/TorrentDownloadItem.vue b/src/components/TorrentDownloadItem.vue index 4ad34af..aa4c96d 100644 --- a/src/components/TorrentDownloadItem.vue +++ b/src/components/TorrentDownloadItem.vue @@ -54,11 +54,16 @@ export default { if ( responseText && (matches = responseText.match( - /(.+)?<\/a>/, + /(.+)?<\/a>/, )) && matches.length >= 3 ) { - _self.downloadTorrent(matches[1], `${matches[2] || title}.torrent`); + let url = matches[1]; + if (url.indexOf("//") === 0) { + url = window.location.protocol + url; + } + + _self.downloadTorrent(url, `${matches[2] || title}.torrent`); } else { _self.$toast.display("获取下载链接失败!"); }