glujan / drpg

Download and keep up to date your purchases from DriveThruRPG
MIT License
18 stars 5 forks source link

Use checksums to determine download worked, not (necessarily) to determine if download is needed? #118

Open rwv37 opened 2 months ago

rwv37 commented 2 months ago

I could easily be misunderstanding, but it looks to me like "--use-checksums" is used to indicate that the checksum should be used as part of determining whether or not a download is required - and that seems to be the only use of checksums. Am I correct about that?

If so, what I would really hope for instead is:

  1. Whether a file should be downloaded or not is determined by (A) whether or not it already has been downloaded, (B) whether or not the timestamps indicate a new version is available, and (C) optionally whether the checksums match.
  2. If a file is to be downloaded, it is downloaded to a temporary directory, and its checksum is verified. If it matches, the file is moved to its permanent home. An option (a different one) would let you to skip the checksum verification in this step.

As someone with an absurd number of files from dtrpg, I would almost never opt for checksumming in (1), and I imagine literally never opt against checksumming in (2). I want to know the file was downloaded properly, always. I do not want to have checksumming done on previously successfully downloaded data every single time I use the program.

This is one of my biggest complaints about the official dtrpg library client app - it takes an amazing amount of time just to get one new file, because it first checks whether or not any single byte of hundreds of gigabytes of previously downloaded data have become corrupted since the last time it ran.

Is there a way to do this, or something like it? Thanks.

glujan commented 2 months ago

Hi! You got right how drpg uses checksums - just to check if a product needs to be downloaded or not.

Having an option to verify the integrity of downloaded files sounds really helpful! Do you feel like submitting a PR for that?

rwv37 commented 2 months ago
"PR" = "pull request"? If so, I'm sorry, no, I've got far too much on my plate at the moment, and only have a passing familiarity with python anyway. Thanks for this project, by the way - I've been using it for the past few days, and it's a godsend. Fighting against DTRPG's official client has taken up an embarrassing amount of my life, and it seems like this one just... works. I wish I had thought to search for an alternative to the official one long ago.
glujan commented 2 months ago

I'll try to prepare it this month

rwv37 commented 2 months ago

Thank you!

glujan commented 2 weeks ago

Just a heads up, I did not forget about it. DriveThruRPG deployed a CloudFlare captcha for downloading files, which is challenging from the drpg point of view.