Use zip (packed nzb's) name as prefix

Want something added? Ask for it here.
Post Reply
Sab-machine
Newbie
Newbie
Posts: 9
Joined: August 10th, 2022, 4:35 pm

Use zip (packed nzb's) name as prefix

Post by Sab-machine »

I regularly use https://nzbking.com. With this site you can make zip-packs of multiple (bulk) NZB's.
So, you usually will store this as the name of the series.

nzbking will name all the nzb's in the zip with a vague name (probably a unique database identifier). For example, we store the file as "MySeries.zip", containing:
* asdtadadasd12adssad.nzb
* hgfhewrasdsadas2w4.nzb

Sabnzbd will use the exact names in the download queue.

My proposal. Lets add a ("special" prefix_zipped_nzbs_with_zip_filename) which will add them as:
* MySeries_asdtadadasd12adssad.nzb
* MySeries_hgfhewrasdsadas2w4.nzb
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Use zip (packed nzb's) name as prefix

Post by sander »

NZBking ... funny site.

I created a zip, here is the list:

Code: Select all

$ unzip -v 63fbdf3799fd053eaa15343e.zip  | awk '{ print $NF }'
63fbdf3799fd053eaa15343e.zip
Name
----
63fbdf3799fd053eaa15343e.nzb
63fbdf3799fd053eaa15343c.nzb
63fbdf3799fd053eaa15343d.nzb
63fbc2f199fd053eaa1514da.nzb
63fbc2f199fd053eaa1514d8.nzb
63fbc2f199fd053eaa1514d9.nzb
If you feed that 63fbdf3799fd053eaa15343e.zip to SABnzbd, how should SAB know "MySeries"? From the above, can you (and thus SAB) tell what the search word was?
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Use zip (packed nzb's) name as prefix

Post by sander »

Even in the post-processing vars, there is no indication of the name:

Code: Select all

/home/sander/.sabnzbd/sab_scripts/post_process_print_all.py
/home/sander/Downloads/complete/63f2c229b32212b30a18d4e1.2
63f2c229b32212b30a18d4e1.nzb
63f2c229b32212b30a18d4e1

*
alt.binaries.mp3
0

SAB_BYTES 1784965
SAB_BYTES_DOWNLOADED 1784965
SAB_BYTES_TRIED 1784965
SAB_CAT *
SAB_CORRECT_PASSWORD
SAB_DUPLICATE 0
SAB_ENCRYPTED 0
SAB_FAIL_MSG
SAB_FILENAME 63f2c229b32212b30a18d4e1.nzb
SAB_FINAL_NAME 63f2c229b32212b30a18d4e1
SAB_GROUP alt.binaries.mp3
SAB_NZO_ID SABnzbd_nzo_z4jr94pd
SAB_OVERSIZED 0
SAB_PASSWORD
SAB_PP 3
SAB_PRIORITY 0
SAB_REPAIR 1
SAB_SCRIPT post_process_print_all.py
SAB_STATUS Running
SAB_UNPACK 1
SAB_UNWANTED_EXT 0
SAB_URL
SAB_FAILURE_URL
SAB_COMPLETE_DIR /home/sander/Downloads/complete/63f2c229b32212b30a18d4e1.2
SAB_PP_STATUS 0
SAB_DOWNLOAD_TIME 0
SAB_AVG_BPS 5610
SAB_AGE 7d
SAB_ORIG_NZB_GZ /home/sander/Downloads/incomplete/63f2c229b32212b30a18d4e1/__ADMIN__/63f2c229b32212b30a18d4e1.nzb.gz
SAB_PROGRAM_DIR /usr/bin
SAB_PAR2_COMMAND /usr/bin/par2
SAB_MULTIPAR_COMMAND
SAB_RAR_COMMAND /usr/bin/unrar
SAB_ZIP_COMMAND /usr/bin/unzip
SAB_7ZIP_COMMAND /usr/bin/7za
SAB_VERSION 3.7.2
Sab-machine
Newbie
Newbie
Posts: 9
Joined: August 10th, 2022, 4:35 pm

Re: Use zip (packed nzb's) name as prefix

Post by Sab-machine »

I guess i was not clear enough.

The user is storing a bulk queue to a zip file. So i am storing to "MySeries.zip".
Sabnzbd can use this filename ("MySeries") to prefix the files *in* the zip file. In your example it would prefix it with "63fbdf3799fd053eaa15343e_".

This way it is somewhat clear what you can expect in a downloaded folder.

Currently i use a custom bash script to prefix the stuff. I understand this is somewhat of a niche request. But nice to have if you download in "bulk"
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Use zip (packed nzb's) name as prefix

Post by sander »

Ah, probably technically possible, but niche case.

You could do the renaming of the .nzb-files in the zip yourself with a tool or a script: unpack and rename with Windows Explorer. Or a python script with os.rename().

Or, totally different approach, maybe this is a solution for you: in a post-processing script, rename the directory to the filename of the biggest file inside that directory (without the extension). That would work if there is one big file per directory (which seems to be the case for NZBking zip file)
Sab-machine
Newbie
Newbie
Posts: 9
Joined: August 10th, 2022, 4:35 pm

Re: Use zip (packed nzb's) name as prefix

Post by Sab-machine »

Would you accept a patch to implement this? Should not clutter the code that much i think.
Implemented as a "special" with default to NOT add the zip filename.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Use zip (packed nzb's) name as prefix

Post by sander »

@Safihre decides on that, not me.

I think best to ask on https://github.com/sabnzbd/sabnzbd/discussions
Sab-machine
Newbie
Newbie
Posts: 9
Joined: August 10th, 2022, 4:35 pm

Re: Use zip (packed nzb's) name as prefix

Post by Sab-machine »

User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Use zip (packed nzb's) name as prefix

Post by sander »

Sab-machine wrote: February 27th, 2023, 5:20 pm Hi Sander, thanks! I created https://github.com/sabnzbd/sabnzbd/discussions/2481
I do not see there whay you wrote here: "Would you accept a patch to implement this? Should not clutter the code that much i think."
Post Reply