snail icon indicating copy to clipboard operation
snail copied to clipboard

torrent文件下载

Open fgagghdshdh opened this issue 1 year ago • 1 comments

只下载空的文件,文件列表的文件下载下来都是0kb final String torrentPath = ""; final Snail snail = Snail.SnailBuilder.newBuilder() .enableTorrent() .buildSync(); // 注册文件选择事件 GuiContext.register(new MultifileEventAdapter()); // 解析种子文件 final Torrent torrent = loadTorrent(torrentPath); // 过滤下载文件 final List<String> list = torrent.getInfo().files().stream() .filter(TorrentFile::notPaddingFile) .map(TorrentFile::path) // .filter(path -> path.endsWith(".mkv")) .collect(Collectors.toList()); // 设置下载文件 MultifileEventAdapter.files(DescriptionWrapper.newEncoder(list).serialize()); // 添加下载 snail.download(torrentPath); // 等待下载完成 snail.lockDownload();

fgagghdshdh avatar Feb 26 '24 08:02 fgagghdshdh

空的文件的意思是没有选中任何下载文件吗

acgist avatar Jun 02 '24 23:06 acgist