I found some magnet with invalid utf8 name fail to download with this library. but meanwhile qbitorrent handle it well.
Maybe we should use BestName function in metainfo.Info and BestPath function in metainfo.FileInfo which may return
human readable name in utf8 to successfully download this kind torrent.
before this patch invalid torrent will produce error message like this.
(base) ➜ Downloads torrent download 'magnet:?xt=urn:btih:0a5e2cbebf846baffd106bc01855bec11f6bd4e9'
361µs: getting torrent info for "infohash:0a5e2cbebf846baffd106bc01855bec11f6bd4e9"
9.145690083s: downloading "仙剑奇侠传三1080P": 0 B/72 GB, 0/4262 pieces completed (0 partial): 0 B/s
...
45.145761083s: downloading "仙剑奇侠传三1080P": 0 B/72 GB, 0/4262 pieces completed (0 partial): 0 B/s
[2024-03-18 09:52:15 +0800 ERR main client github.com/anacrolix/torrent peer.go:713]
*torrent.PeerConn 0x1400129a008: writing received chunk 2047: open ?ɽ?????????1080P/?ɽ?????????01.mkv: no such file or directory
after this patch this torrent is successfully downloaded as 仙剑奇侠传三1080P
running on macOS sonoma 14.4 with M2 pro
I found some magnet with invalid utf8 name fail to download with this library. but meanwhile qbitorrent handle it well. Maybe we should use
BestName
function in metainfo.Info andBestPath
function in metainfo.FileInfo which may return human readable name in utf8 to successfully download this kind torrent.before this patch invalid torrent will produce error message like this.
after this patch this torrent is successfully downloaded as 仙剑奇侠传三1080P