Author Topic: Renaming obfuscated 7z joined files to NZB name  (Read 3237 times)

Offline thefireman

  • Contributor
  • ***
  • Posts: 16
Renaming obfuscated 7z joined files to NZB name
« on: September 14, 2019, 08:22:12 PM »
It seems that recently the releases in split 7z files has been increasing, compared to the percentage they used to represent in the past.

As it is today, split 7z files are joined and saved as a joined 7z file. This 7z files are named after the subject name of the release, which nowadays is usually obfuscated. So, when the releases are obfuscated and several obfuscated 7z files end up in the same folder, it gets harder to separate them and find which 7z file is which release.

It would be nice if the joined .7z were renamed to the corresponding imported NZB filename, instead of the NZB subject name contained in the NZB. This would make it easier to identify the files. :)
« Last Edit: September 14, 2019, 08:27:45 PM by thefireman »

Offline dh2

  • Contributor
  • ***
  • Posts: 34
Re: Renaming obfuscated 7z joined files to NZB name
« Reply #1 on: October 12, 2019, 04:57:57 PM »
I think that your request is strongly related to my request "Proper recognition & unpacking of multi-part 7zip files" from
October 22, 2018.

I think that if you look at what is DLed, that it might be something likee   blahblah.7z.001 blahblah.7z.002 blahblah.7z.003 and so on and that if you manually unzip them with 7zip, instead of having AltBinz do the jog,  that you will either get an mkv or mp4 file or what ever.

Basically, if AltBinz was able to recognize multipart 7zip files & treat them accordingly, that you would end up with properly named mkv or mp4 files, if you've set AltBinz to rename video files to nzb name, instead of obfuscated 7zip files. Problem is that as of right now, AltBinz treats blahblah.7z.001 blahblah.7z.002 blahblah.7z.003 as a split file, thus joining all of the files into 1 bit 7z file

Offline thefireman

  • Contributor
  • ***
  • Posts: 16
Re: Renaming obfuscated 7z joined files to NZB name
« Reply #2 on: October 15, 2019, 07:26:40 PM »
Yes, I understand what you are saying, but I remember that Rdl had mentioned there is a lot of work involved in implementing what you are suggesting. So I think this is not worth implementing as the .7z files are not so common.
I really don't mind manually extracting the joined .7z files, as long as they keep the collection name and I know what they contain. ;)

Offline dh2

  • Contributor
  • ***
  • Posts: 34
Re: Renaming obfuscated 7z joined files to NZB name
« Reply #3 on: November 03, 2019, 05:48:19 PM »
I wasn't aware that Rdl had addressed this, thanks for letting me know.

I DL each post to a seperate folder that is named after the nzb name & unpack within that folder. If I manage to spot that the DL is a multi part 7zip, then I use Shift+Ctrl+N to inform AltBinz not to unpack.

I'm not that good at writing batch files & know just about nothing about powershell scripts, but did find the following 2 that turned out to be very helpful.

The 1st one is a batch file that I execute in that parent folder where I have these DLs, each being in a seperate folder.
This unpacks the 7zip, each in the floder that its loctaed in.  Content of the batch ( xxx.bat ) file:

ECHO OFF
for /F "delims=" %%I in ('dir ".\*.7z" /A-D /B /S 2^>nul') do ".\7Zip\7z.exe" x -o"%%~dpI" -bb0 -y -- "%%I" >>log.txt
ECHO ON

if the DL was unpacked & I have some big .7z files I keep "dir ".\*.7z" in the bat file but if I manged to spot & stop an unpack, then I edit dir ".\*.7z  to   dir ".\*.001.  & looking thru the log.txt file I can see if there were any errors.     ".\7Zip\7z.exe"   in the bat file needs to be edited to point to where you have 7x.exe

Now I have a xxxx.mkv files in each folder with a obfuscated name. Now I execute this powershell command

Get-ChildItem i:\Downloads -Filter *.mkv -Recurse | Rename-Item -NewName { $_.Directory.Name + ".mkv"}

i:\Downloads needs to be changed to where all of the folders with the obfuscated mkv files are

This powershell command renames the mkv files to the folders name.  You can substitute  *.mkv  with  *.7z  or whatever is is you're trying to rename.  This line can go in a powershell script, but then you have to go thru hassle of certifying the script.  You can run a command to set execution policy to unrestricted, but then you need to remember to set it back to restricted afterwards, as unrestricted is considered to be a security risk.

There is probably a much easier way to do this, but at a pinch, it works. The 7z files will also still be there. I will have to be deleted either manually or bat or Remove-Item in powershell

Reading your original post in this thread, I get the impression that you might be DLing to one location & unrar/unpack into another location, so what I do will not work  ;(