qbittorrent / qBittorrent

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

Seed mismatched torrents #10943

Open Ryrynz opened 5 years ago

Ryrynz commented 5 years ago

Sometimes when cross seeding there can be small differences between torrents. I sometimes encounter torrents that only check to 99% and thus can't be seeded, they are however 100% for other trackers. It would be very cool for qBitorrent to have the ability to simply create another directory where the mismatched contents could be stored without overwriting the mismatched files. This way one could cross seed without having to duplicate the whole torrent in another location.

FranciscoPombal commented 5 years ago

You can make use of symbolic links (symlinks) to cross-seed easily, which is the functionality that you are basically describing.

zinemaniac commented 5 years ago

From what i have seen when running a check it's usually an .nfo file that is mismatched. Just deselect that one and seed the rest. If it's an entire avi that is mismatching then it's not the same file.

Ryrynz commented 5 years ago

Wouldn't you then no longer count as seeding but as leeching as you don't have the entire torrent available? Do trackers keep note of what's being seeded?

zinemaniac commented 5 years ago

It doesn't matter since it's your upload stat that will be counted. It's as if you download a torrent and you download much slower than you seed. The upload stat still counts even though you are "leeching".

Ryrynz commented 5 years ago

There are bonus points awarded for seeding.

zinemaniac commented 5 years ago

There are bonus points awarded for seeding.

It wasn't bonus points that was discussed. Now if those matters to you then just download whatever is mismatching and you will get your bonus points and still be seeding more than you have downloaded.

Ryrynz commented 5 years ago

I'm not looking for alternatives.. LOL.

loskutov commented 1 year ago

In fact, modern file systems (XFS, Btrfs, ZFS, APFS) are copy-on-write and can deduplicate your files. Here's a brief demonstration with Linux and Btrfs:

% echo "content for tracker 1" > foo
% dd if=/dev/urandom of=foo bs=32M count=1 oflag=append conv=notrunc
0+1 records in
0+1 records out
33554431 bytes (34 MB, 32 MiB) copied, 0.32422 s, 103 MB/s
% # Now foo has around 32MiB of data
% cp --reflink foo bar # Note the `--reflink`, by default cp (unless coreutils-9.0) will not deduplicate your files!
% dd if=<(echo "content for tracker 2") of=bar conv=notrunc # Imitate torrent client overwriting a piece...
0+1 records in
0+1 records out
22 bytes copied, 0.00214698 s, 10.2 kB/s
% diff --text foo bar
1c1
< content for tracker 1
---
> content for tracker 2
% filefrag -v foo
Filesystem type is: 9123683e
File size of foo is 33554453 (8193 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..    8192:      77872..     86064:   8193:             last,shared,eof
foo: 1 extent found
% filefrag -v bar
Filesystem type is: 9123683e
File size of bar is 33554453 (8193 blocks of 4096 bytes)
 ext:     logical_offset:        physical_offset: length:   expected: flags:
   0:        0..       0:      86065..     86065:      1:            
   1:        1..    8192:      77873..     86064:   8192:      86066: last,shared,eof
bar: 2 extents found

So, the file foo is represented by a single contiguous extent of 8193 blocks (physical offsets 77872..86064), and bar has two extents: one block to store the unique prefix and then 8192 blocks shared with foo (physical offsets 77873..86064).

In other words, all you need to do is use a modern FS (ext4 has no support for reflinks, unfortunately) and clone your torrents with cp --reflink (assuming Linux and gnu-coreutils older than 9.0, starting from 9.0 CoW is the default behaviour), and FS will do the rest, no matter what torrent client you use.