#1
|
|||
|
|||
![]()
I've been bashing my head against the Packagizer function in JDownloader 2 and I don't think I fully understand how it works.
Let's say I go to some arbitrary website and the filename that JDownloader "sees" and puts into my LinkGrabber looks like: Code:
#String1 !String2 $String3 &String4 @String5.ext Let's say I don't want "#String1" in my final filename, or I want to replace "$String3" with something else because it's misspelled or something. I'm used to being able to code scripts like: Code:
String.Replace("#String1", ""); Code:
String.Replace("$String3", "$ReplacementString3"); I've looked at the existing Packagizer examples in the forum, but most of those posts have screenshots that are no longer hosted or the examples are usually about appending, not remove/replace. Could someone help me out with the Packagizer equivalents of what I'm trying to do above? Thanks! Last edited by derillianstone; 06.02.2024 at 07:44. Reason: edit |
#2
|
||||
|
||||
![]()
Hi,
the Packagizer can't do replaces in that classic way. What it can do is something like "take everything after #String1 and use that as a new filename" or also you can use regular expressions to extract multiple pieces of the given filename and create a new filename out of them. In some cases that enables you to do the same things that a replace would do, in others not. Please check our Packagizer docs and examples: https://support.jdownloader.org/Know...paketverwalter You will find more examples in our forums. Here is one example which shows how to extract the domain of the source-URL using regular expressions and put it into the final filename: https://support.jdownloader.org/Know...to-filename/20 If you are planning to do more complex stuff like advanced replaces, you will need to use an EventScripter script: EventScripter forum thread: https://board.jdownloader.org/showthread.php?t=70525 EventScripter help article: https://support.jdownloader.org/Know...event-scripter --> That is way more complicated but on the plus side this would enable you to use replace functions in the way you probably know them.
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
![]() |
Thread Tools | |
Display Modes | |
|
|