qbittorrent / qBittorrent

qBittorrent BitTorrent client
https://www.qbittorrent.org
Other
28.01k stars 3.95k forks source link

`_` path entry created for torrents with 0 length string in `path` key (`0:`) #21229

Open YenForYang opened 2 months ago

YenForYang commented 2 months ago

qBittorrent & operating system versions

qBittorrent: 4.6.5 x65 Operating system: Windows 10 Pro 22H2 x64

What is the problem?

There are some older private torrents (from 2013, 2014) that I added to qBittorrent recently. According to the files it looks like these are torrents created with ruTorrent (PHP Class - Adrien Gibrat). Each one of these odd torrents had a _ subfolder was created in addition to the root folder. Note, I do have the "create subfolder" option ticked so that subfolders will always be created, though it should only apply for torrents without root folders (i.e. single file torrents). To illustrate: image

I'm pretty sure that years ago when I originally first downloaded the torrent this issue didn't come up, but not 100% positive. Pretty confident though.

Steps to reproduce

I investigated to torrent files with Torrent File Editor (GUI) and some hex comparison software. It looks like if I expand the raw tree:

...
 "created by" : "ruTorrent (PHP Class - Adrien Gibrat)",
 "creation date" : 1234567890,
 "info" : {
  "files" : [
   {
    "length" : 123456,
    "path" : [
     "",
     "file.wmv"
    ]
   },
...

Note the empty "" path entry.

Looking at the raw data of the torrents, it looks like under the 4:path list it has a 0: entry (see asterisks below): ...4:infod5:filesld6:lengthi123456e4:pathl**0:**8:file.wmveee... Removing the 0: fixes the issue, but modifies the torrent file. I believe qBittorrent should simply ignore these entries, and simply not create a _ folder.

One can probably reproduce the issue by adding a 0: after the 4:path for a list entry in the info dict. (basically something like 4:path;0:12:filehere.jpgee for )

Additional context

No response

Log(s) & preferences file(s)

No response

stalkerok commented 2 months ago

Could you please find the original torrent file or please provide a hash of this torrent.