#1
|
||||
|
||||
Packagizer - change file name basing on regex
Hello.
I've searched a couple of threads, but could not find any good solution. I can not even make any solution work.... Example file name: "this is a name ? Yes! Caution: this is a new file..." So.. what would be a regex rule for this ? I'm using regex everyday at work, but I can not understand how it works in JD... I mean, I do not know how to use it here in JD application. I need my file contain ONLY: [a-zA-Z0-9-_\s\.] How would I set this in JD packagizer settings ? PS.The problem is Im using linux, which does use characters not allowed in Windows (I am using both os'), so ie. ?:"<>*:|\/ are not allowed. But JD downloading in linux need to to know, that a filename should be changed. Finally, I need my regex to rename files, after adding to the download list, to for instance spaces, or dashes, or underscores... one of these. Please give me a hint, solution or whatever, because I'm stuck... ;/ |
#2
|
||||
|
||||
JDownloader uses Java Pattern and there are minor differences but in general they work completely the same.
You can only use for matching groups. In Packagizer you can only use it for match and make use of matching group. JDownloader automatically replaces all those forbidden/reserved characters. But you cannot customize the replacement yet I'm not aware of any missing forbidden/reserved character and you should be able to start download on linux and resume on windows without any manual interaction. As a workaround you might wanna try the Eventscripter extension and a script that does the replacement in custom way, see https://board.jdownloader.org/showthread.php?t=70525 In case you need help with it, please contact mpgai for help or post in that thread
__________________
JD-Dev & Server-Admin Last edited by Jiaz; 29.10.2019 at 15:39. |
#3
|
||||
|
||||
Please look at the screenshot attached
Ok, I understand.
I'll show You an example: file name is: "What is it ???" And my screenshot with description is: Is this rule well formed ? I mean, I tried to set "contains" with regexp active, for this: [a-zA-Z0-9_-\.]+ but... I need something, that will check if the group as I wrote, is the only group of characters that can exist in file names. So every file name with a sign NOT in this group will be replaced by... anything else, maybe underscore, or maybe completely with a new file name generated by me. These regex's need to be described somewhere, I mean, how t ouse it, visually, maybe on some videos. To say which options to use: "contains", "does not contain", "equal", "different" etc.. and then a couple of examples - something like a topic for eveeryone who want to use Packagizer to do something. Eval scripting is more advanced - not a problem, but the problem is time. I just want to check for a simple group of chars. Yes, I know I can download all my desired files in Windows, and then all the files will be acceptable in Linux as well as In Windows. But what if I want to download them on... linux ?:huh: |
#4
|
||||
|
||||
I'm sorry if I didn't explain good enough. The current code works for all supported OS. That means you don't have to take care of forbidden/reserved characters. You can download the file on supported OS X and continue/use on supported OS Y or download on Y and continue on X. You don't have to take care of this by yourself
__________________
JD-Dev & Server-Admin |
#5
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#6
|
||||
|
||||
Quote:
"Test" -> contains "Test" -> yes -> contains "House" -> no -> contains NOT "House" -> yes -> contains NOT "Test" -> no -> equals "Test" -> yes -> equals "Test2" -> no
__________________
JD-Dev & Server-Admin |
#7
|
||||
|
||||
Your example rule does the following
->name - contains - ? then set -> set name to "aaaaaa" so every filename that contains a ? will be "aaaaaa" then. Packagizer -> you define one/multiple(AND) *if conditions* and may use regex as well and then set one/multple *set actions* that may make use of defined matching groups
__________________
JD-Dev & Server-Admin |
|
|