JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 27.03.2025, 09:59
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default Upside-down (inverted) question and exclamation marks

Hi,

by default JDownloader changes question and exclamation marks in filenames to upside-down question and exclamation marks. I don't want this to happen, instead I do want to keep the regular question and exclamation marks in my filenames.

Already I tried to add lines to Settings->Advanced Settings->GeneralSettings.filenamereplacemap, but all I ever get is an error message:

Quote:
java.util.regex.PatternSyntaxException: Dangling meta character '?' near index 0
What can I do?

Thanks in advance!
Reply With Quote
  #2  
Old 27.03.2025, 10:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,269
Default

@babaloo: The configuration is JSON syntax, you have to proper encode it AND proper escape your characters in Pattern
If you don't want to change the character, just remove it from the setting
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 27.03.2025, 10:13
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

Addendum:

Use (web)tools like jsoneditoronline.org to properly pre-check json data and also to be able to edit it in an easier way.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #4  
Old 28.03.2025, 08:36
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

Thanks for getting back at me.
Quote:
Originally Posted by Jiaz View Post
If you don't want to change the character, just remove it from the setting
Where and how can I do that? I thought some character changes, like exchanging a proper question mark with an inverted one, where hard coded into jDownloader. If I can just remove those changes that would be great!
Reply With Quote
  #5  
Old 28.03.2025, 08:58
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

See Settings -> Advanced settings:
Code:
GeneralSettings.packagenamereplacemap
and:
Code:
GeneralSettings.filenamereplacemap
To avoid mis-understandings:
You cannot just remove that replacement because question marks are not allowed in filenames (yes I know, technically you could use them under Linux; we still don't allow them).
So do not remove the entry but select another replace of your choice otherwise after that cleanup any remaining illegal chars will be replaced with underscore.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #6  
Old 28.03.2025, 09:05
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

Quote:
Originally Posted by pspzockerscene View Post
…question marks are not allowed in filenames (yes I know, technically you could use them under Linux; we still don't allow them).
That's a bummer. Question marks are perfectly fine on macOS as well and as I said in my first post I actually do want to keep them in my filenames.

So unless JDownloader changes this policy I will have to look for another download manager, because I don't want to change upside down question marks into real ones after the fact.
Reply With Quote
  #7  
Old 28.03.2025, 09:10
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

I'm sorry, but at this moment, we do not plan to change this.

We have given this matter careful consideration before implementing it and concluded that maintaining consistency across all systems is the best approach for several reasons, including:

- You might be using Linux/Mac while setting a download destination on a Windows SMB drive. Allowing these chars would lead to download path problems then.
- Allowing these characters could cause issues when migrating JD configurations from one OS to another.

Here are your options:

1. Keep the current handling as it is and use an external application/script to rename the inverted question marks back to their intended characters.

2. or: Use an EventScripter script to achieve this (though I'm very unsure if this will work, as our internal replacement may interfere).

EventScripter subforum:
https://board.jdownloader.org/forumdisplay.php?f=52
EventScripter help article:
https://support.jdownloader.org/know...event-scripter
EDIT

Addendum:
Before we had the replace map, we just replaced all of these characters with underscores.
The new handling is intended to use similar replacements in order to be able to track the original character/meaning and not just losing it.
I understand that from your perspective this is still not _right_ :(
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?

Last edited by pspzockerscene; 28.03.2025 at 09:12. Reason: EDIT
Reply With Quote
  #8  
Old 28.03.2025, 09:19
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

Thanks for explaining your decision.

Those two options don't work for me. I tried EventScripter but didn't get very far. Maybe because it won't work at all but it's easily possible that the whole thing is too complicated for me. I am not a coder at all.

And everything after the fact, i.e. after the finished download, doesn't work with my workflow.
Reply With Quote
  #9  
Old 28.03.2025, 09:21
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

You only talked about the EventScripter option.
Why does the first option (external application/script) not work for you?

Quote:
Originally Posted by babaloo View Post
And everything after the fact, i.e. after the finished download, doesn't work with my workflow.
I don't understand.
Please explain in more details.
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #10  
Old 28.03.2025, 09:32
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

That's a big story. I often help students with video editing. Those students are spread all over the world and upload their clips on different platforms and services. Sometimes I deal with a single student, but most of the time it is about a project involving several students in several locations. In order to keep things organized and as simple as possible on my end I have a set of automations working, that are partially based on filenames.

This whole thing has been developed over years, works flawlessly but is a mess, if you look at it closely. I don't want to fiddle with it, especially as we are in a few big projects currently. But filenames are the basis of the automations, so they have to be as the students and I intended them to be. And in a couple of cases question marks are an important variable.
Reply With Quote
  #11  
Old 28.03.2025, 09:37
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

Quote:
Originally Posted by babaloo View Post
This whole thing has been developed over years, works flawlessly but is a mess, if you look at it closely.
I'd say the same about JDownloader :D

See I'm unable to provide a solution for you here and now but if you want I can create a ticket so we can address this in the future (we will not provide any ETA though!).
I can think about an explicit opt out advanced setting aka "disable internal replacement of illegal characters".

By the way; JDownloader is open source so as a 3rd option, you can of course change the code to allow these characters.
See:
https://support.jdownloader.org/know...up-ide-eclipse

See:
LinknameCleaner.java:
Function: cleanFilename

And/or one lever higher:
CrossSystem.java
Function: alleviatePathParts
Code:
Spoiler:
Code:
    public static String alleviatePathParts(String pathPart, final boolean removeLeadingHidingDot) {
        if (StringUtils.isEmpty(pathPart)) {
            if (pathPart != null) {
                return pathPart;
            }
            return null;
        }
        pathPart = pathPart.trim();
        /* remove invalid chars */
        /**
         * Integer value zero, sometimes referred to as the ASCII NUL character.
         *
         * Characters whose integer representations are in the range from 1 through 31->\\x00-\\x1f
         *
         * < (less than), * > (greater than), : (colon), " (double quote), / (forward slash), \ (backslash), | (vertical bar or pipe), ?
         * (question* mark) (asterisk)
         *
         * Volume designators (drive letters) are similarly case-insensitive. For example, "D:\" and "d:\" refer to the same volume.
         */
        pathPart = pathPart.replaceAll("([\\\\|<|>|\\||\r|\n|\t|\"|:|\\*|\\?|/|\\x00-\\x1f])+", "_");
        if (CrossSystem.isWindows() || CrossSystem.isOS2()) {
            /**
             * **External links are only visible to Support Staff**             */
            if (CrossSystem.isForbiddenFilename(pathPart)) {
                pathPart = "_" + pathPart;
            }
        }
        /*
         * replace starting dots by single dot (prevents directory traversal)
         */
        if (removeLeadingHidingDot) {
            pathPart = pathPart.replaceFirst("^\\.+", "");
        } else {
            pathPart = pathPart.replaceFirst("^\\.+", ".");
        }
        /*
         * remove ending dots, not allowed under windows and others os maybe too
         * 
         * Do not end a file or directory name with a space or a period.
         */
        pathPart = pathPart.replaceFirst("\\.+$", "");
        pathPart = pathPart.trim();
        if (StringUtils.isEmpty(pathPart)) {
            return "_";
        } else {
            return pathPart;
        }
    }
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
Reply With Quote
  #12  
Old 28.03.2025, 10:41
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

An opt-out would be great. Thanks for thinking about it.

And over the weekend I will have a bit of time and might look at changing the code. No idea though which can of worms I'd be opening then. :D

By the way, thanks a lot for what you guys are doing here at JDownloader. You really care about your "product" as much as about the community. I'd hate to leave a place like this.
Reply With Quote
  #13  
Old 28.03.2025, 11:03
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,677
Default

Quote:
Originally Posted by babaloo View Post
An opt-out would be great. Thanks for thinking about it.
Ticket:

Just to clarify this again:
This ticket does not mean that the feature will ever be added.
It's just a marker for us to collect the demand and to not forget about user requests.


Me personally, I'am on your side:
I think it makes sense to allow these characters (at least as a setting) for "advanced users who know what they're doing".
EDIT Also, I really like customizable applications like JDownloader that allow the user to configure them however they want them to behave.

Quote:
Originally Posted by babaloo View Post
And over the weekend I will have a bit of time and might look at changing the code. No idea though which can of worms I'd be opening then. :D
You will spend more time setting up the IDE than "fixing" this. Probably all you need to do is to comment-out that one line I highlighted in my last post.
For bonus points, you can properly implement it and add a setting right away :D

Quote:
Originally Posted by babaloo View Post
By the way, thanks a lot for what you guys are doing here at JDownloader. You really care about your "product" as much as about the community. I'd hate to leave a place like this.
Thanks for your kind words
EDIT2

Small addendum:
Here is an interesting thread in which we've chatted in depth about this topic with another user:
https://board.jdownloader.org/showthread.php?t=95411
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?

Last edited by pspzockerscene; 28.03.2025 at 11:18. Reason: EDIT2
Reply With Quote
  #14  
Old 28.03.2025, 15:00
babaloo babaloo is offline
Vacuum Cleaner
 
Join Date: Oct 2017
Posts: 18
Default

Thanks again!

Quote:
Originally Posted by pspzockerscene View Post
I really like customizable applications like JDownloader that allow the user to configure them however they want them to behave.[/url]
I hear you! For example I really like Apple and most of their products, hardware as well as software. Alas, more often than not Apple has a very specific idea on how to use their software. Which is good for beginners, because the resulting cleaner look makes it much easier to dive into a new software compared to a bloated one.

But even experienced users often can't adjust a software's behaviour to their liking. Very frustrating!

So every setting that allows me to use a software as I want to is good.
And yes, bury the dangerous stuff deep down in a settings' submenu, give a warning or two when a user enables it, but allow for the freedom.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 11:31.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.