I create a NZB file and can confirm: a "sample" directory is not removed
https://raw.githubusercontent.com/sande ... 8ceff2.nzb
./sample.bin # removed by SABnzbd
./random100MB.bin
./my-date.txt
./sample # NOT removed
./sample/random100MB.bin # NOT removed
What the log shows (sabnzbd.log:10753-10759):
- sample.bin matches the sample pattern, so it's deleted (lines 10754–10755).
- sample/random100MB.bin is only tested on its own name, random100MB.bin, which doesn't match. It survives and shows up later during deobfuscation (line 10759).
- The sample folder itself is never checked or mentioned at all.
The code (/home/sander/git/sabnzbd/sabnzbd/postproc.py:1302):
for root, _dirs, files in os.walk(path): # _dirs is ignored
for file_to_match in files:
full_path = os.path.join(root, file_to_match)
if is_sample(full_path):
is_sample() (sabnzbd/misc.py:1233) applies RE_SAMPLE to os.path.basename(...) only, so the folder name sample in the path is never tested. On top of that, remove_samples only ever calls remove_file(). Even if every file inside sample/ were deleted, the empty folder would stay.
So ... also check for "sample" in directory names (but only in the downloaded / created dirs, so not in full path like /home/PeterSample/complete/blabla/linux.iso )