dtrx-py / dtrx

Do The Right Extraction
GNU General Public License v3.0
224 stars 10 forks source link

Add password options for 7z, zip, rar and arj #51

Closed sr-verde closed 8 months ago

sr-verde commented 1 year ago

Closes #50

Since I want to use dtrx to extract archives in non-interactive mode, even if they are password protected, I started to write a patch to enable dtrx to do this. This PR is currently a draft because

  1. it only supports ZipExtractor, SevenExtractor and RarExtractor
  2. it uses f-strings, which are not supported in Python 2.7

If this draft seems good, I'd like to add password support for the other extractors as well (for those libraries that support encrypted archives).

Regarding f-strings: Shouldn't dtrx drop support for Python 2?

I'm happy to hear your comments!

ChrisJefferson commented 1 year ago

Thanks. This looks like a good direction! One useful thing to add would be tests for all the encrypted formats we want to support (the way tests are implemented isn't really documented, but it's (hopefully) not too hard to understand. The test will (I imagine) look a lot like a current test (could take the existing files and just add encryption?) -- the pass options:.

In terms of python 2, my preference would be to support it if it's not that difficult -- as dtrx is an "easy to use" end-user program, there are a bunch of people running old OSes which are still on Python 2, who use dtrx (I know a couple personally), who I wouldn't want to have to teach how to install Python 3.

Of course, if something turns out to be difficult to implement in Python 2, that would be a reason to abandon support.

sr-verde commented 1 year ago

Thank you Chris for your quick response. I love dtrx for my daily work and it is also a great tool for automation. With the password option added I can use it as a full replacement for patool. That would be so good.

For this PR it is a no brainer to support py v2. I only noticed the v2 support after writing the code. Of course I will write tests as well.

sr-verde commented 1 year ago

Okay, I've added the password option to unar and arj as well. And added some tests. I would appreciate your feedback if something is missing.

ChrisJefferson commented 1 year ago

Hi, just to say sorry I've been slow looking at this, life has gotten busy, but it is on my list to get to.

DeflateAwning commented 8 months ago

This would be great to get merged!

sr-verde commented 8 months ago

Anything I can do to get this merged, @ChrisJefferson?

ChrisJefferson commented 8 months ago

Sorry for the delay, I tested and this all looks good.

dilinger commented 3 months ago

Just curious, what's the plan for a new release? I'd like to play around with this new feature, but if there's a planned release then I'll just wait for that so I can simultaneously update the debian package. @noahp