JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 16.09.2021, 18:13
EmilMilano EmilMilano is offline
Junior Loader
 
Join Date: Sep 2021
Posts: 11
Default Linkcrawler rewrite rule.

Hello!, I tried going to the examples to make my own rules, but I couldn't understand much. I want to take the video code of a link and then attach it to another link.

Example 1 : **External links are only visible to Support Staff****External links are only visible to Support Staff**

This link must be converted to : https:///vk.com/video168595557_170203793

Some videos have a hyphen before the video code so it must be accounted as well.

Example 2 : **External links are only visible to Support Staff****External links are only visible to Support Staff**

This link must be converted to : https:///vk.com/video-168595557_170203793

Any tips?
Reply With Quote
  #2  
Old 16.09.2021, 18:55
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

Hi again,
the following simple LinkCrawler Rule will do the job:

Code:
[
  {
    "enabled": true,
    "name": "example rule for type REWRITE",
    "pattern": "https?://adult\\.noodlemagazine\\.com/watch/(-?[0-9]+_[0-9]+)",
    "rule": "REWRITE",
    "rewriteReplaceWith": "**External links are only visible to Support Staff**
  }
]
Rule in plaintext for easier copy & paste:
pastebin.com/raw/LQ02WBcr

Please let us know which parts of our example and the LinkCrawler Rules overview can be improved.

-psp-
__________________
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 16.09.2021, 19:35
EmilMilano EmilMilano is offline
Junior Loader
 
Join Date: Sep 2021
Posts: 11
Default

Hmm, I believe the symbols as in "?,$,\,|...etc" (the ones that would mostly be used) would need to explained as what they do in the code mainly in layman's terms. With provided examples. It would make it easier for anyone to make the code themselves.

The example gives hints on what they might do but without much digging around the internet it is very hard to find out what they actually do and to understand their function. It took me a while to understand the function of the "?" symbols and that was the only one I understood.

What you've said in the rules overview page is true. Without a basic understanding of RegEx it is near impossible make the code for ourselves. I've looked around the net to learn basics. And most guides doesn't make sense without a basic understanding of JS. So I think it is better to provide a detailed guide with few examples to make sure the user understands the basics. So they can do the quick fixes for themselves. Like in my case. And thank you very much for the help!
Reply With Quote
  #4  
Old 16.09.2021, 19:47
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

Quote:
Originally Posted by EmilMilano View Post
Hmm, I believe the symbols as in "?,$,\,|...etc" (the ones that would mostly be used) would need to explained as what they do in the code mainly in layman's terms. With provided examples. It would make it easier for anyone to make the code themselves.
No the main article does explain that Regular Expression knowledge is required and in which fields regular expressions are used.
It also links a RegEx help/learn page (regex101.com).
Sure we could backlink to the main article from every given example but that would mess the articles up if you ask me.
And also yes, we could write our own tutorial about regular expressions but why should we?
Regular expressions have a basic syntax and the Internet is full of good tutorials so I don't see the need to reinvent the wheel here.

Quote:
Originally Posted by EmilMilano View Post
And most guides doesn't make sense without a basic understanding of JS.
I strongly disagree.
You do not have to be a developer to understand Regular expressions but it is certainly helpful.

Quote:
Originally Posted by EmilMilano View Post
So I think it is better to provide a detailed guide with few examples to make sure the user understands the basics.
Which other examples would you like to have?
Our given examples are more about the LinkCrawler Rules functionality than learning RegEx but as said this would really blow up the article.
... but maybe linking some good articles to learn RegEx would be an idea?
From what I understood you said it was hard to find good tutorials?

Quote:
Originally Posted by EmilMilano View Post
And thank you very much for the help!
Thanks for your feedback and please do not misunderstand this reply:
Feedback is important and my post is not supposed to just block it I just don't think that it's worth the effort making custom RegEx tutorials.
After all you will find a lot of other LinkCrawle Rules examples in this support forum.

-psp-
__________________
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
  #5  
Old 16.09.2021, 21:52
EmilMilano EmilMilano is offline
Junior Loader
 
Join Date: Sep 2021
Posts: 11
Default

Yes the main problem was, it was very hard to find good articles and most of them recommended or assumed you have a basic knowledge of Js which is why I said that.

In my opinion, A simple tutorial or a small guide about about RegEx would do wonders and most users need RegEx just to do quick fixes as I did. And yes links to good articles and examples would do just as well.

Thanks for helping my issue again!
Reply With Quote
  #6  
Old 17.09.2021, 11:37
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

How about e.g. this one?
regexone.com
__________________
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
  #7  
Old 17.09.2021, 16:18
EmilMilano EmilMilano is offline
Junior Loader
 
Join Date: Sep 2021
Posts: 11
Default

Lol, That's really funny. That's exactly the kind of site I was trying to find, guess I wasn't looking hard enough. Thank you so much!
Reply With Quote
  #8  
Old 17.09.2021, 16:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,291
Default

@pspzockerscene: indeed a very nice learning site!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 17.09.2021, 16:24
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,922
Default

It was like the 7th google result but yeah the others were not that easy to understand.
I like this one too.

I've linked it in our main Packagizer article and LinkCrawler Rules article.

Have a nice weekend!
__________________
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 13:19.
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.