#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
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** } ] 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 |
#3
|
|||
|
|||
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! |
#4
|
||||
|
||||
Quote:
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:
You do not have to be a developer to understand Regular expressions but it is certainly helpful. Quote:
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? 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 |
#5
|
|||
|
|||
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! |
#6
|
||||
|
||||
How about e.g. this one?
regexone.com
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#7
|
|||
|
|||
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!
|
#8
|
||||
|
||||
@pspzockerscene: indeed a very nice learning site!
__________________
JD-Dev & Server-Admin |
#9
|
||||
|
||||
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 |
|
|