Skip to content

Commit

Permalink
fix: torrent download failed
Browse files Browse the repository at this point in the history
fix #205
  • Loading branch information
kuoruan committed Dec 25, 2023
1 parent 5ab91b0 commit e8cad70
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/TorrentDownloadItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,16 @@ export default {
if (
responseText &&
(matches = responseText.match(
/<a href="((?:https?)?\/\/dl\.dmhy\.org\/[^"]+\.torrent)">(.+)?<\/a>/,
/<a(?:.+)href="((?:https?:)?\/\/dl\.dmhy\.org\/[^"]+\.torrent)"(?:.*)>(.+)?<\/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("获取下载链接失败!");
}
Expand Down

0 comments on commit e8cad70

Please sign in to comment.