JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 06.02.2024, 07:44
derillianstone derillianstone is offline
Modem User
 
Join Date: Jan 2024
Posts: 3
Default Packagizer help - modifying/replacing specific strings in an incoming filename?

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
Where there's some arbitrary sets of strings, usually preceded by a symbol like ! or @ or #.

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", "");
or
Code:
String.Replace("$String3", "$ReplacementString3");
but it doesn't appear that I can do these in Packagizer. I'd like to be able to do something like this so I don't have to run separate scripts in my directories afterwards.

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
Reply With Quote
  #2  
Old 06.02.2024, 12:32
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,983
Default

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
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
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 12:43.
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.