Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1. magnet 链接得解析速度过慢 2. SelectFiles 下载方式 bug #143

Closed
MrGlp opened this issue Jul 7, 2023 · 2 comments
Closed

Comments

@MrGlp
Copy link
Contributor

MrGlp commented Jul 7, 2023

magnet:?xt=urn:btih:f72f831066469eafe21fccbd8c3e7d3f5288775d&dn=%e5%bd%a2%e7%8a%b6&tr=udp%3a%2f%2fopentracker.i2p.rocks%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.altrosky.nl%3a6969%2fannounce

  1. 这边使用 go 调用 Resolve 方法解析 magnet 链接内容,解析速度很慢,经常数分钟之久
    不清楚为什么这么慢,这个解析方法还没有到下载,我的预期应该也是 1s,2s 可以返回,但是现在和预期差距较大

这个问题啥原因,业内其他工具没用过不知道会不会由相同得问题,有没有解决办法
代码如下
resolveRes, err := Downloader.Resolve(&base.Request{
URL: "magnet:?xt=urn:btih:f72f831066469eafe21fccbd8c3e7d3f5288775d&dn=%e5%bd%a2%e7%8a%b6&tr=udp%3a%2f%2fopentracker.i2p.rocks%3a6969%2fannounce&tr=udp%3a%2f%2ftracker.altrosky.nl%3a6969%2fannounce",
})
if err != nil {
fmt.Println("resolver err")
panic(err)
}

  1. 上面这个磁力链接解析出来俩文件,一个电影 mp4 文件几 GB,一个 txt 说明文件 几kb
    我指定 SelecyFiles = 1,只下载 txt 说明文件,但是现状是,数秒后说明文件和电影都被下载到了本地,但是电影文件是损坏的无法看,我的预期是他就不应该被下出来

这个问题有解决方案么
代码如下
taskId, err := Downloader.Create(resolveRes.ID, &base.Options{
Path: "./download/gopeed/file2",
SelectFiles: []int{1},
Extra: http.OptsExtra{
Connections: 8,
},
})
if err != nil {
panic(err)
}
fmt.Println("taskId: ", taskId)

@monkeyWie
Copy link
Member

  1. 解析慢可以多加点tracker服务,内置的traker服务很多都被墙干扰了,也可以开梯子试试
  2. 这个问题只能在下载完成之后手动删除多余文件,因为bt下载中一个piece可能会落到不同的文件上,如果不存下来做不了hash校验也做不了seeder

@MrGlp
Copy link
Contributor Author

MrGlp commented Jul 10, 2023

okk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants