JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 21.06.2024, 05:52
TGU TGU is offline
Mega Loader
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 65
Default LinkCrawler Rule - Add LinkName/PackageName

The one big downside to the LinkCrawler rules are that you aren't able to customize the filenames using the same extracted html. I'm sure you can also use the event scripter and re-fetch the page, and extract the filename, and rename it however it just makes sense to add this ability.

Using regex match groups, allow the user to rename any link/files using extracted information (and support some packagizer dynamic variables?). Also adding "packageName" which acts the same as the "linkName" within the example.

If "linkName" is null do not rename, if "packageName" is null and "packageNamePattern" is given use the first group match ($1).

If a regex group ($1, $2, $3, $4...) is used, and is missing do not rename. (how do you handle this currently with packageNamePattern?)

If no regex group are used within "linkName"/"packageName", the name will still be renamed to whatever is given.

Given a website: (**External links are only visible to Support Staff****External links are only visible to Support Staff**)
Code:
<html>
<head>
<title>site - test title</title>
</head>
<body>
<h3>test title</h3>
<img src="**External links are only visible to Support Staff**>
</body>
</html>
Linkcrawler Rule:
Code:
{
  "enabled": true,
  "maxDecryptDepth": 1,
  "rule": "DEEPDECRYPT"
  "packageNamePattern": "<title>(.*?)</title>"
  "linkName": "$1 - <jd:orgfilename>"  // Use regex groups(multiple groups are allowed $1, $2, $3...) from the linkNamePattern, and dynamic variables (or just one variable for now to get the original filename)
  "linkNamePattern": "<h3>(.*?)</h3>"
}
Original filename: "7364.jpg"
Renamed filename: "test title - 7364.jpg"

note: should "linkName" be "fileName"?

Last edited by TGU; 21.06.2024 at 06:20.
Reply With Quote
  #2  
Old 21.06.2024, 10:41
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,997
Default

Quote:
Originally Posted by TGU View Post
The one big downside to the LinkCrawler rules are that you aren't able to customize the filenames using the same extracted html.
I agree.
Your post is a duplicate of the following german thread:
https://board.jdownloader.org/showthread.php?t=86379
Ticket:

The idea of this ticket is that you could set "custom plugin properties" on rule result items which you can then use wherever you want via Packagizer rules.

Quote:
Originally Posted by TGU View Post
Using regex match groups, allow the user to rename any link/files using extracted information (and support some packagizer dynamic variables?). Also adding "packageName" which acts the same as the "linkName" within the example.
I'm not sure what you mean by "linkName", you mean, that would be the "filename from URL if present"?

Parts of your request seem to involve move complex handling which should be done via EventScripter.
LinkCrawler rules should be simple with not too much logic/scripting involved.

Quote:
Originally Posted by TGU View Post
...<jd:orgfilename>...
According to your example, either you've failed to understand what "<jd:orgfilename>" is or I failed to understand how your request is ment.
<jd:orgfilename> is not present at this stage since it is the "already set/present filename" but at this stage, it is completely unclear what will be the resulting item so there is no such name given.
It looks like you are trying to get a system which allows for multiple fallbacks.
That would be something for this idea:
https://board.jdownloader.org/showthread.php?t=90744

So at this moment I only agree with your main point: It would be nice to have the ability to set a filename using LinkCrawler rules slash regex slash matches from the surrounding html code.
However, as you can see the other related ticket is from 2021 so this definitely won't be added any time in the near future.
At this moment, all I can suggest is the method "set package name via rule, then later set package name as filename using a Packagizer rule", see:
https://support.jdownloader.org/de/k...me-as-filename
...or use EventScripter scripts.

As you know, JDownloader is open source so feel free to start working on features like this yourself - I'm sure the community will be thankful.
__________________
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
  #3  
Old 21.06.2024, 18:29
TGU TGU is offline
Mega Loader
 
Join Date: Jun 2024
Location: International Waters where DRM/DMCA protections are ignored
Posts: 65
Default

"linkName" is a rename format of the link/file name which uses the matches found within "linkNamePattern".

The $1, $2... represents regex matched groups and the "<jd:orgfilename>" was more of a placeholder value for referencing the existing file name (extracted typically via the URL?).

Using regex match groups, and a reference to the original filename with your own format you can basically rename the filename with anything extracted from the URL's html.

This feature seems like a 1/5 way between what's currently available and the german thread you have listed, It seems quite different. But I suppose If I don't want to wait until 2030 I have to do it myself
Reply With Quote
  #4  
Old 24.06.2024, 09:31
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,997
Default

Quote:
Originally Posted by TGU View Post
But I suppose If I don't want to wait until 2030 I have to do it myself
That is about as accurate as it gets.

We are only a small team and with the currenrt sets of changes we are pusing each week, feel free to count the hours we are already investing and calculate what's left to develop new poweruser-features like this one.

If you got code changes you'd want to contribute, contact us here or via support@jdownloader.org.
__________________
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 08:51.
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 - 2024, Jelsoft Enterprises Ltd.