If they are two different files of the same torrent, you can simply move both files to the same (incompleted) download data (filename needs to exactly the target). Then do a recheck and your Bittorrent client will compare your new file situation against the known torrent checksums.
If your downloaded pieces are from the same file. It gets a bit worse. I wonder that nobody wrote a tool for this because the algorithm for a potential tool is quite straight and simple:
- read all checksums
- open both/all files/incompleted downloads
- loop through all chunks
- check if one of this downloads contains the correct hash
- take this hash and write it to the 'target download'
- delete all other input files
As already said, for a tool this is a simple task. If you don't have such a tool (i don't know one), you can merge your file manually, which works in the case your client didn't download garbage (=parts which don't match the checksum). In this case you can use a tool which only copies non-empty blocks. dd if=inputfile.dat of=outputfile.dat bs=1024 conv=notrunc,sparse
can do this, just adjust bs=
(block size) parameter to the chunk size of your download file. At the end, rescan your file in your Torrent client, and it should find more chunks than before.
2
You can do it by mergetorrent utility.
– Alexey Markov – 2014-04-03T10:38:54.527