Knowledgebase: LinkCrawler Rules
LinkCrawler REWRITE example
Posted by pspzockerscene psp, Last modified by pspzockerscene psp on 02 February 2022 05:07 PM

LinkCrawler Rule example - REWRITE

REWRITE rules can be used to do the following tasks:

  • Make JD accept URLs it otherwise wouldn't accept
  • Let JD "learn" file-extensions which it does not accept by default
  • Modify added URLs

Simple example - modify URL to be able to download it:

Let's say you got this URL which is broken:
http://cdn8.appwork.org/speed.zip/thisPartIsNotNeeded.html
JD will not pickup this URL and/or it will get displayed as offline.
The correct URL would be:
http://cdn8.appwork.org/speed.zip
The following rule will fix this:

[ {
"enabled" : true,
"name" : "example rule for type REWRITE",
"pattern" : "(https?://cdn8\\.appwork\\.org/speed.zip)/thisPartIsNotNeeded\\.html",
"rule" : "REWRITE",
"rewriteReplaceWith" : "$1"
} ]