Unpackerr / unpackerr

Extracts downloads for Radarr, Sonarr, Lidarr, Readarr, and/or a Watch folder - Deletes extracted files after import
https://unpackerr.zip
MIT License
1.04k stars 38 forks source link

Add filename-embedded password support to Folder feature. #199

Closed furchtlos76 closed 2 years ago

furchtlos76 commented 2 years ago

I installed your great tool via docker on a synology. Just want to use it with downloadstation. Added the variables UN_FOLDER_0_PATH UN_FOLDER_0_EXTRACT_PATH UN_DEBUG

And as i understood in the issues it should extract rars in folders what have the password in {{password}} form. But even if i move a .zip file it shows the same. Unreadable. Is there any other thing i have to configure in variables? i even runed the docker in root mode, ut still the same. changeing permissions of the folders in filestation on the synology did not help. And i cant find a way to open a shell of this docker to check permissions and so on on the CLI. /bin/bash or /bin/sh both not found. Is there any other trick?

This is what the logs throw out:

2022/04/29 19:14:40.978331 folder.go:69: => Folder Config: 1 path: /temp/, extract to: /finished/ (delete after:0s, delete orig:false, log file: true, move back:false, event buffer:20000) 2022/04/29 19:16:09.301241 folder.go:335: [DEBUG] Folder: Ignored File Event: /temp/foldername{{password}} (unreadable)

furchtlos76 commented 2 years ago

I could get THIS problem fixed, it was the problem i mounted the folders with tailing / /temp/ and /finished/ when only doing /temp and /finished that works. Thanks alot

davidnewhall commented 2 years ago

You're good now?

furchtlos76 commented 2 years ago

@davidnewhall yes at least this problem is fixed, took me hours, to find out it makes the problems because of that stupiud tailing slash :-) BUT i just added another bug/or problem now

furchtlos76 commented 2 years ago

@davidnewhall sorry for doing that bug report wrong. In Issue #101 another user had the same problem. Files or better folders of those rar files, have the password to unrar the encrypted files in the directory name. this is quite common, at least on usenet. The directory names are like in #101 described like this:

Name{{Password}}

like for example

Really.cool.Release{{vXnIxmun2H391JPjkz3N}}

But unfortuatly i get the following error on all directorys i tryed yet to automaticaly unpack with unpackerr. Using official docker. Any idea what is missing? Usiing folder mode only. The log says incorrect password, But when i copy/paste what is inside {{ }} like in the example vXnIxmun2H391JPjkz3N it IS the correct password and unpacks with total commander for example.

2022/04/29 20:45:54.209236 folder.go:260: [Folder] Extraction Error: /temp/Really.cool.Release{{vXnIxmun2H391JPjkz3N}}: rarReader.Next: rardecode: incorrect password | stdout

davidnewhall commented 2 years ago

Files without passwords extract OK?

furchtlos76 commented 2 years ago

Yes. Others are fine.

022-04-29T21:09:14.120440270Z stdout 2022/04/29 21:09:14.118602 queue.go:202: [DEBUG] Extracting File: /temp/Testrelease/Downloads.zip to /fertig/Testrelease_unpackerred
2022-04-29T21:09:14.119848838Z stdout 2022/04/29 21:09:14.117979 folder.go:242: [Folder] Queued: /temp/Testrelease, queue size: 0
davidnewhall commented 2 years ago

I don't actually think the password-in-a-filename feature works for Folders. It only works for Starr apps. Will have to add this.

furchtlos76 commented 2 years ago

But maybe i just did missunderstand the thread in issue #101 as i read it, you added the support to unpack those files that have the password inside the foldername (not filename) by extracting the password out of the {{}} part at the end of the dirname.

davidnewhall commented 2 years ago

I did. For Starr apps, not for watched folders. The code runs here https://github.com/davidnewhall/unpackerr/blob/ade1bb33b3f36d0616a385371233d8f20d3e069b/pkg/unpackerr/handlers.go#L93 and that only fires when a starr app finishes a download. I need to add it here: https://github.com/davidnewhall/unpackerr/blob/ade1bb33b3f36d0616a385371233d8f20d3e069b/pkg/unpackerr/folder.go#L222-L223

furchtlos76 commented 2 years ago

It looks like this

Directory: Cool.Release{{v656nIxmuN2H391JPjkz3N}} Files inside this directory: kekfhutuhjn37528785276235n.part01 kekfhutuhjn37528785276235n.part02 kekfhutuhjn37528785276235n.part03 kekfhutuhjn37528785276235n.part04

To extract those i copy and paste the party {{v656nIxmuN2H391JPjkz3N}} without the {{ and }} and can unpack it.

furchtlos76 commented 2 years ago

ahh ok, than i missunderstood this. I was just searching for some tool that does alot of work when using synology dowloadstation to download. as the inbuild unpacker does not work very good and not with password (well you have to add a password list). Please add this to the wishlist, dont know how hard it is to add this to the docker.

davidnewhall commented 2 years ago

It's a +1 line change. Should be able to have something for you to try in a day or two.

furchtlos76 commented 2 years ago

It's a +1 line change. Should be able to have something for you to try in a day or two.

Wow! Please send me some link to send you a tipp like paypal or so, as this would be wonderfull! Thanks alot!

davidnewhall commented 2 years ago

No worries. I don't accept money for my work. Give it to your favorite charity.

davidnewhall commented 2 years ago

@furchtlos76 Try this docker tag golift/unpackerr:unstable Let me know if that is able to extract your password protected archives. Thanks!

furchtlos76 commented 2 years ago

Thanks soooooo much! Works perfect! Gerat support!!!!

furchtlos76 commented 2 years ago

One last question on this, how can i find out, when this fix is also in the :latest tag, so i can switch to latest stable version?