dht - 为什么 DHT 在使用无跟踪器 torrent 下载时找不到资源?

标签 dht tracker torrent

请像我在您的 vps 中所做的那样,然后可能会重现该问题,请替换变量 $vps_ip在以下步骤中使用您的真实 vps ip。

wget  https://saimei.ftp.acc.umu.se/debian-cd/current/amd64/iso-cd/debian-10.4.0-amd64-netinst.iso
transmission-create -o  debian.torrent   debian-10.4.0-amd64-netinst.iso

创建一个无跟踪器的洪流,在上面显示信息:
transmission-show  debian.torrent
Name: debian-10.4.0-amd64-netinst.iso
File: debian.torrent

GENERAL

  Name: debian-10.4.0-amd64-netinst.iso
  Hash: a7fbe3ac2451fc6f29562ff034fe099c998d945e
  Created by: Transmission/2.92 (14714)
  Created on: Mon Jun  8 00:04:33 2020
  Piece Count: 2688
  Piece Size: 128.0 KiB
  Total Size: 352.3 MB
  Privacy: Public torrent

TRACKERS

FILES

  debian-10.4.0-amd64-netinst.iso (352.3 MB)

打开在您的 vps 上运行传输的端口。
firewall-cmd --zone=public --add-port=51413/tcp --permanent
firewall-cmd --reload

从您的本地电脑检查它。
sudo nmap $vps_ip -p51413
Host is up (0.24s latency).
PORT      STATE SERVICE
51413/tcp open  unknown
Nmap done: 1 IP address (1 host up) scanned in 1.74 seconds

添加 torrent 并在您的 vps 上使用传输的默认用户名和密码(如果您已经更改,请使用您自己的用户名和密码):
transmission-remote  -n  "transmission:transmission"  --add  debian.torrent
localhost:9091/transmission/rpc/ responded: "success"
transmission-remote  -n  "transmission:transmission"  --list
ID     Done       Have  ETA           Up    Down  Ratio  Status       Name
   1     0%       None  Unknown      0.0     0.0   None  Idle         debian-10.4.0-amd64-netinst.iso
Sum:              None               0.0     0.0
transmission-remote  -n  "transmission:transmission"  -t 1 --start
localhost:9091/transmission/rpc/ responded: "success"

获取 debian.torrent从你的 vps 到本地电脑。
scp root@$vps_ip:/root/debian.torrent   /tmp  

现在尝试将其下载到本地 PC。
aria2c --enable-dht=true  /tmp/debian.torrent

06/08 09:28:04 [NOTICE] Downloading 1 item(s)

06/08 09:28:04 [NOTICE] IPv4 DHT: listening on UDP port 6921

06/08 09:28:04 [NOTICE] IPv4 BitTorrent: listening on TCP port 6956

06/08 09:28:04 [NOTICE] IPv6 BitTorrent: listening on TCP port 6956
 *** Download Progress Summary as of Mon Jun  8 09:29:04 2020 ***              
===============================================================================
[#a34431 0B/336MiB(0%) CN:0 SD:0 DL:0B]
FILE: /tmp/debian-10.4.0-amd64-netinst.iso
-------------------------------------------------------------------------------

我等了大约一小时,下载进度总是 0%。

最佳答案

如果您使用的是 DHT,则必须在防火墙中打开一个 UDP 端口,然后根据您的操作,您可以将该端口指定为 aria2c。从文档:

DHT uses UDP. Since aria2 doesn't configure firewalls or routers for port forwarding, it's up to you to do it manually.


$ aria2c --enable-dht --dht-listen-port=6881 file.torrent

this page有关在 aria2c 中使用 DHT 的更多示例。

关于dht - 为什么 DHT 在使用无跟踪器 torrent 下载时找不到资源?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62253737/

相关文章:

java - Torrent 跟踪器对每个请求都使用相同的对等 ID 进行回复?

node.js - rtorrent xml-rpc 命令加载 torrent 并从 Nodejs 获取添加的 torrent 的 id

download - 使用aria2c完成下载后如何立即关闭连接?

php - 抓取多轨种子 php

dht - 在 Holochain-rust 中,获取并显示所有用户列表的最佳方式是什么?

networking - 为什么 Kademlia 使用 UDP?

php - 解码 Torrent 跟踪器抓取的 Torrent 哈希?

protocols - 种子中的 DHT

networking - 自 2001 年以来的 P2P 覆盖网络?

php - 在 PHP 中翻译 torrent 的公告请求中的 info_hash