Filename truncated when source contains square bracket

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
guitarboy
Jr. Member
Jr. Member
Posts: 69
Joined: January 7th, 2010, 2:44 am

Filename truncated when source contains square bracket

Post by guitarboy »

Example filename: XXX.YYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost

Download succeeds but ends up in the path "C:\Downloads\complete\TV\XXX.YYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost\eztv.1.re"

Windows doesn't recognize it as an .MKV file and it is not moved into the "C:\Downloads\complete\TV\XXX YYY\Season 2" folder.

Is there a switch to prevent this from happening?
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Filename truncated when source contains square bracket

Post by sander »

Can you see in sabnzbd.log why this is happening? Is it because of Series renaming / sorting / ... ?


And maybe ... Config -> Switched -> "make Windows compatible" helps?

EDIT:

I've create a test NZB with brackets for you: https://raw.githubusercontent.com/sande ... reMore.nzb
In SABnzbd, add it as URL, and download it. What is the resulting naming of the file ... ?

It works nicely (on my Ubuntu), and I expect too on your setup...
guitarboy
Jr. Member
Jr. Member
Posts: 69
Joined: January 7th, 2010, 2:44 am

Re: Filename truncated when source contains square bracket

Post by guitarboy »

Can you see in sabnzbd.log why this is happening? Is it because of Series renaming / sorting / ... ?
The filename appears to be truncated in the Incomplete folder right after download completes. e.g.

Code: Select all

2023-08-06 13:07:25,291::DEBUG::[deobfuscate_filenames:112] Checking: <HASH><HASH>4e5392b1b7a77f
2023-08-06 13:07:25,291::DEBUG::[deobfuscate_filenames:124] Obfuscated: starting with 40+ lower case hex digits and/or dots
2023-08-06 13:07:25,292::DEBUG::[nzbstuff:1902] Saving attributes {'cat': 'tv', 'pp': 3, 'script': 'None', 'priority': 0, 'final_name': 'XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost', 'password': None, 'url': None} for XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost
2023-08-06 13:07:25,293::DEBUG::[assembler:79] Decoding part of \\?\C:\Downloads\incomplete\XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost\eztv.re
2023-08-06 13:07:25,293::DEBUG::[filesystem:1119] [sabnzbd\nzbstuff.py.save_to_disk] Saving data for SABnzbd_nzo_9v7es620 in \\?\C:\Downloads\incomplete\XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost\__ADMIN__
2023-08-06 13:07:25,344::INFO::[assembler:87] Decoding finished \\?\C:\Downloads\incomplete\XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost\eztv.re
2023-08-06 13:07:25,365::DEBUG::[nzbstuff:453] Removing article database for SABnzbd_nzf_v3_7rd1a
2023-08-06 13:07:25,365::DEBUG::[filesystem:913] [sabnzbd\nzbstuff.py.remove_admin] Deleting file \\?\C:\Downloads\incomplete\XXXX.YYYYY.S02E01.1080p.WEB.h264-EDITH[eztv.re].mkv-xpost\__ADMIN__\SABnzbd_nzf_v3_7rd1a
The log file is too long to embed here but I can send it to you.
And maybe ... Config -> Switched -> "make Windows compatible" helps?
I can't find this switch. I searched the Config page but it doesn't appear. Advanced Settings is checked.
In SABnzbd, add it as URL, and download it. What is the resulting naming of the file ... ?
C:\Downloads\complete\RefTestNZB_1234_Brackets[fake.re]MoreMore\MyRandomFile_100MB[fake.re]MoreMore.bin

That appears to be correct.

Using SABnzbd 4.0.3 [9fafe64]
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Filename truncated when source contains square bracket

Post by sander »

But do you have Sorting on? So: http://127.0.0.1:8080/sabnzbd/config/sorting/


Make Windows compatible is here:
http://127.0.0.1:8080/sabnzbd/config/sw ... itize_safe
guitarboy
Jr. Member
Jr. Member
Posts: 69
Joined: January 7th, 2010, 2:44 am

Re: Filename truncated when source contains square bracket

Post by guitarboy »

But do you have Sorting on? So: http://127.0.0.1:8080/sabnzbd/config/sorting/
Yes, Series Sorting is enabled and set to: %sn/%sn - S%0sE%0e - %en.%ext
Make Windows compatible is here:
http://127.0.0.1:8080/sabnzbd/config/sw ... itize_safe
Not there! Here's a screenshot of that page: https://imgur.com/a/7zWsbBo
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Filename truncated when source contains square bracket

Post by sander »

> Not there!

Ah. Maybe because you are on Windows that option is not there. And that feature is then on by default.

Anyway: I think we can safely say it's due to Sorting. And I know about nothing about that. Wild guesses for the cause: the brackets have a special meaning in regular expressions. And even .re has a meaning: it means ... regular expression.

Maybe someone else can help further.
User avatar
OneCD
Hero Member
Hero Member
Posts: 596
Joined: March 4th, 2017, 3:47 pm

Re: Filename truncated when source contains square bracket

Post by OneCD »

sander wrote: August 7th, 2023, 1:22 am > Not there!

Ah. Maybe because you are on Windows that option is not there. And that feature is then on by default.
The 'Naming' section only appears on that page when you check the 'Advanced Settings' box at the top-right of the screen. ;)
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
guitarboy
Jr. Member
Jr. Member
Posts: 69
Joined: January 7th, 2010, 2:44 am

Re: Filename truncated when source contains square bracket

Post by guitarboy »

The 'Naming' section only appears on that page when you check the 'Advanced Settings' box at the top-right of the screen.
“Advanced Settings” is turned on. As @Sander says, the switch doesn’t appear to be available on Windows.
User avatar
safihre
Administrator
Administrator
Posts: 5521
Joined: April 30th, 2015, 7:35 am
Contact:

Re: Filename truncated when source contains square bracket

Post by safihre »

Indeed it's not shown on Windows.
But this sounds indeed like a bug, if you happen to have a Github account could you create an Issue on our Github?
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
guitarboy
Jr. Member
Jr. Member
Posts: 69
Joined: January 7th, 2010, 2:44 am

Re: Filename truncated when source contains square bracket

Post by guitarboy »

But this sounds indeed like a bug
Which is the bug: the hidden Windows switch or the anomalous renaming?

I’m happy to report either or both.
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Filename truncated when source contains square bracket

Post by sander »

The renaming, with Sorting on. And you have the standard sorting, so that's good.
wadsworth
Newbie
Newbie
Posts: 3
Joined: June 27th, 2023, 10:21 pm

Re: Filename truncated when source contains square bracket

Post by wadsworth »

I believe I'm hitting this same issue for nzb file names containing square brackets, although it seems to occur regardless of whether sorting is enabed.
In my case the files are renamed to ".h264" instead of ".re" like the original poster.

Further details and log file here...
pastebin DOT com SLASH WKYRa7RU

My NZB search indexer shows the correct extensions on the files, such as:
* small file is the .nfo
* large file is the .mkv

Happy to provide further details or open a bug if needed, just let me know.
User avatar
sander
Release Testers
Release Testers
Posts: 9061
Joined: January 22nd, 2008, 2:22 pm

Re: Filename truncated when source contains square bracket

Post by sander »

wadsworth wrote: October 19th, 2023, 10:38 pm I believe I'm hitting this same issue for nzb file names containing square brackets, although it seems to occur regardless of whether sorting is enabed.
In my case the files are renamed to ".h264" instead of ".re" like the original poster.

Further details and log file here...
pastebin DOT com SLASH WKYRa7RU

My NZB search indexer shows the correct extensions on the files, such as:
* small file is the .nfo
* large file is the .mkv

Happy to provide further details or open a bug if needed, just let me know.

If you look inside the .NZB itself, you see the subject (which should tellthe filename):

subject="[PRiVATE]-[WtFnZb]-[/Blbabla.2021.S02E04.1080p.WEB.h264-EDITH[eztv.re].mkv-WtF[nZb]/WtF[nZb].nfo]-[2/2] - &quot;&quot; yEnc 12 (1/1)"

So: a lot of []'s and even an embedded []. I had an (ugly?) workaround for that in SABnzbd, but AFAIK Safihre decided he did not want that in the SABnzbd code.

Furthermore, in SAB, "h264" is defined as a common extension, so SAB does not change the extesion to .mkv
wadsworth
Newbie
Newbie
Posts: 3
Joined: June 27th, 2023, 10:21 pm

Re: Filename truncated when source contains square bracket

Post by wadsworth »

Thanks for taking a look sander. I'll take check the subject and report back.
Post Reply