BiglySoftware / BiglyBT

Feature-filled Bittorrent client based on the Azureus open source project
https://www.biglybt.com
GNU General Public License v2.0
1.55k stars 153 forks source link

using BiglyBT in k3b #2321

Closed as-muncher closed 2 years ago

as-muncher commented 2 years ago

I am really grateful for BiglyBT's Search for Existing Data Files function. I know I wish k3b had something like that, to deal with bad sectors, that maybe if I had 2 or 3 copies of a dvd, all the good sectors could be pooled together to make a dvd with fewer or no bad sectors.

ferdnyc commented 2 years ago

@as-muncher The problem is, how could it know?

BiglyBT's piece-management functionality works because every piece of a BitTorrent share is checksummed ahead of time, which allows it to maintain a map of which pieces are valid and which aren't. k3b has no way of telling a good DVD image from a bad one, or of telling which sectors are valid and which aren't.

There have been other tools that offered functionality along those lines, including checksumming images. EAC (which stands for Exact Audio Copy) comes immediately to mind — it's a Windows tool for making archival copies of music CDs and DVDs by tracking good vs. bad sectors while ripping.

But the EAC developers will be the first to warn, the problem is that consumer drives can't (or at least won't) provide accurate data about good and bad sector reads during the ripping process. Any software that wants to ensure a flawless read is ultimately forced to resort to effectively just guessing which data is valid and which isn't. (Either that, or retrying each rip multiple times and checking for any blocks that change from read to read, an incredibly time-consuming process.

When creating a torrent, a known-good and known-complete copy of the original file is used to create the checksums that can later be used to validate partial downloads. But without having a complete original file and collecting the necessary data ahead of time, the information just isn't readily available to reconstruct it from partial data later.

as-muncher commented 2 years ago

@ferdnyc I just thought that maybe k3b would mark which sectors of the CD it had trouble reading, because if it can say that it had an error while reading, maybe it might mark that on the new CD or DVD and then if there were good sectors on another DVD, then it could merge them to make a good DVD. But thanks for the thoughtful response. I enjoyed reading it.

ferdnyc commented 2 years ago

@as-muncher *nod* I think K3b, specifically, isn't really about recovering bad media — that requires a whole set of tools that are kind of outside of K3b's targeted featureset, and would only be useful to a tiny percentage of its userbase — too small a percentage to justify including those features, probably.

(Another issue is that even having "the same DVD" doesn't mean the contents are identical. Which they would have to be, in order to use one disc to recover a damaged image from another. There must be dozens of different iterations of any given DVD release, all with different filesystem contents or layouts. Which may then be translated into even more different possible image files. The type of checksum-style recovery offered by BitTorrent clients requires byte-for-byte identical (though incomplete) files. But disc images of even the exact same disc will vary (and therefore be incompatible) depending on the software used, the options selected while creating it, etc.)

There are tools that can be employed for the purpose of recovering damaged discs. dvdisaster (which I guess lives at https://dvdisaster.jcea.es/ now) is the first one that springs to mind. It works by effectively creating the equivalent of a .torrent file's checksum data, for the disc image contents — the part that I mentioned K3b not having, in order to do recovery.

The user manual even discusses a scenario where two different (damaged) copies of a disc are used, along with an after-the-fact error-correction scan, to construct a working "good" image for the disc. (They mention that as an un-ideal scenario, of course, since the intent of dvdisaster is to collect data from a good disc before it's needed for recovery — much like a .torrent file's checksums are constructed from the intact file, before it's (potentially) transferred incomplete to other peers.)

ferdnyc commented 2 years ago

Oh, hah! Except for one major shortcoming I forgot about: dvdisaster doesn't support factory-pressed CD-ROM, DVD-ROM, or BD-ROM discs — only writable ±R/RW and -RAM discs. Also, no audio CDs even if burned.

(This is explicitly a legal consideration, otherwise dvdisaster checksum data could theoretically be distributed and used to duplicate commercial media, by enabling "reconstruction" of copy-protected disc contents.)

as-muncher commented 2 years ago

@ferdnyc Thanks for the info about dvdisaster. I hadn't heard of them before.