qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

A private torrent suddently becomes a public torrent

Open yegle opened this issue 2 months ago • 7 comments

qBittorrent & operating system versions

qBittorrent: 4.6.4 x64 OS: Synology DSM 7 (run qBittorrent in Docker) Qt: 6.6.2 Libtorrent: 2.0.10.0

What is the problem?

Sorry if the title is a bit confusing.

I use qBittorrent to download content from private trackers exclusively, all my torrent files should be private torrents.

I've seen at least 3 times when a torrent finishes 99% and suddenly it stuck at "Fetching Metadata" (or something similar, sorry I forgot the exact words). For some PT site, I even got a tracker error message "Banned client".

I've been confused by this behavior for a long time and finally noticed one of the PT site showed the user agent I used was curl/7.81.0, which led me to https://github.com/arvidn/libtorrent/blob/8a7aa8311387b8d530a2ec2a3eb5974fec5edb64/src/http_tracker_connection.cpp#L247-L249.

Reading the libtorrent code around it, it seems like the curl/7.81.0 user-agent is only used when anonymous mode is enabled (I did enable it), and the torrent is a public torrent (this should NOT be the case!). And when I check the torrent, sure enough I don't see DHT/PeX/LSD disabled with a "this torrent is private" message!

Since I was able to download the torrent to 99% w/o get banned message, the torrent must initially a private torrent when added to qBittorrent, and suddenly becomes a public torrent at a later time.

I grabbed the $HASH.fastresume file and it indeed show disable_{dht,lsd,pex}: 0:

{
   "active_time": 218803,
   "added_time": 1713467502,
   "allocation": "allocate",
   "apply_ip_filter": 1,
   "auto_managed": 1,
   "banned_peers": "<hex>xxxx</hex>",
   "banned_peers6": "<hex>xxxx</hex>",
   "completed_time": 1713511697,
   "disable_dht": 0,
   "disable_lsd": 0,
   "disable_pex": 0,
   "download_rate_limit": -1,
   "file-format": "libtorrent resume file",
   "file-version": 1,
   "file_priority": [
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1,
      1
   ],
   "finished_time": 171117,
   "httpseeds": [],
   "i2p": 0,
   "info-hash": "<hex>xxxx</hex>",
   "info-hash2": "\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
   "last_download": 1713511697,
   "last_seen_complete": 1713680617,
   "last_upload": 1713680616,
   "libtorrent-version": "2.0.10.0",
   "max_connections": 100,
   "max_uploads": 10,
   "name": "xxxx",
   "num_complete": 6,
   "num_downloaded": 16777215,
   "num_incomplete": 1,
   "paused": 0,
   "peers": "<hex>xxxx</hex>",
   "peers6": "",
   "pieces": "",
   "qBt-category": "cccc",
   "qBt-contentLayout": "Original",
   "qBt-firstLastPiecePriority": 0,
   "qBt-inactiveSeedingTimeLimit": -2,
   "qBt-name": "",
   "qBt-ratioLimit": -2000,
   "qBt-seedStatus": 1,
   "qBt-seedingTimeLimit": -2,
   "qBt-stopCondition": "None",
   "qBt-tags": [],
   "save_path": "xxxx",
   "seed_mode": 0,
   "seeding_time": 171117,
   "sequential_download": 0,
   "share_mode": 0,
   "stop_when_ready": 0,
   "super_seeding": 0,
   "total_downloaded": 9323709715,
   "total_uploaded": 5644609077,
   "trackers": [
      [
         "https://xxxx",
         "https://xxxx",
         "https://xxxx"
      ]
   ],
   "upload_mode": 0,
   "upload_rate_limit": -1,
   "url-list": []
}

Steps to reproduce

I don't know how to reproduce this issue, this seem to happen spontaneously when a torrent is almost finished download.

Additional context

No response

Log(s) & preferences file(s)

No response

yegle avatar Apr 21 '24 09:04 yegle