[LinkCrawler Rule] Substring in Download URL ersetzten
Hallo,
ich würde gerne (beim Crawlen?) einen konstanten Substring von bestimmten URLs gegen einen anderen tauschen.
Wenn ich die URL einer Bildergalerie auf **External links are only visible to Support Staff**www.meinbezirk.at kopiere, findet JDownloader alle Bilder. Das ist schon mal sehr super.
Die Bilder dort gibt es in mehreren Auflösungen, wobei die mit "_XXL" die größten sind.
Ich weiß jetzt aber, dass es die Bilder in noch höherer Auflösung gibt, die statt "_XXL" mit "_NATIVE" enden
z.B
Bildergalerie:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Bild mit "_XXL" Substring:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Bild mit "_NATIVE" Substring:
**External links are only visible to Support Staff****External links are only visible to Support Staff**
Wobei der Substring am Ende mit "?/d+" obsolet zu sein scheint. Der Server liefert in beiden Fällen das gleiche Bild.
Wie kann ich JDownloader dazu bringen, dass er immer versucht die Bilder in der höchsten Auflösung (mit "_NATIVE" am Ende) herunterzuladen?
linkcrawler rules mean you don't have to make a plugin for simple fetching tasks. more complicated tasks it is best to create decrypter plugin. You are free to still do this, if you're not scared of some work =]
i assume for this task, of just replacing a substring, its sufficient to use the link crawler. But how to use it? is there any tutorial for the syntax?
why do i need an id? what number has to be used?
is the pattern key the url of the gallery, or the image?
how to tell it to replace "_XXL" with "_NATIVE"?
id can be left out and it will be generated. its more so for internal tracking which rule triggered what etc, and probably to potentially indicate a rule that failed, or dupe rules etc
pattern is the pattern you trigger the event (forum url not image)
deepPattern is the image url (image)
second rule you will do it based on the image url as directhttp (this rule only needed if they are not say prot://domain/file.jpg)
third rule to change the url from xxl or what ever with listeners, alter the url with component(s) listened to and amend your changes.
i dont understand your answer. i tried many ways - for hours now. i am frustrated.
Can you please just show me how how to replace a substring w/ another one so that everytime i paste a link like *XXL* is replaced by *NATIVE*.
I have learned from Assembler over COBOL to C++ and Java, and i also understand the concept of RegEx.... but this linkCrawler rules are really a pain in the ass.
Why dont you take (at least) one day and write one wiki page with at least the most important rules and give a few examples so that everyone can help to improve this software?
ich würde gerne (beim Crawlen?) einen konstanten Substring von bestimmten URLs gegen einen anderen tauschen.[...]
Hier ist eine simple LinkCrawler Regel, die alle "XL" und "XXL" Bilder/URLs zu "NATIVE" macht:
Spoiler:
Code:
[{
"enabled" : true,
"logging" : false,
"maxDecryptDepth" : 1,
"name" : "example rule meinbezirk.at replace _XL with _NATIVE",
"pattern" : "(**External links are only visible to Support Staff**,
"rule" : "REWRITE",
"packageNamePattern" : null,
"passwordPattern" : null,
"formPattern" : null,
"deepPattern" : null,
"rewriteReplaceWith" : "$1_NATIVE.jpg"
}]
Hier nochmal auf nem Pastebin um unsere Foren-Zensur (Datenschutzgründe) zu umgehen:
pastebin.com/EGeVVw31
Quote:
Originally Posted by BerndBosch
PS: Ich kann auch Java programmieren
Das ist sehr gut!
Wir sind open source und du darfst gerne Code beisteuern.
Bedenke außerdem, dass du mit LinkCrawler Regel nur relativ simple Dinge tun kannst - je mehr dein Crawler "können soll", desto sinnvoller ist es, ein eigenes Crawler Plugin (in Java) für JD zu schreiben.
Das was du hier möchtest scheint mir aber noch per LinkCrawler Regeln möglich zu sein.
Du köttest dir nun z.B. noch eine zweite Regel erstellen, die einzelne "meinbezirk.at" Artikel-URLs erkennt und dort alle Bilder sucht --> Kann kannst du diese Links auch über die Zwischenablagenüberwachung in JD einfügen und bekommst genau die Links, die du möchtest und nicht z.B. auch alle .js URLs aus dem html Code der meinbezirk Webseite.
Quote:
Originally Posted by BerndBosch
Hello raztoki,
i dont understand your answer. i tried many ways - for hours now. i am frustrated.[...]
Well with my above rule you should easily accomplish your goal.
Quote:
Originally Posted by BerndBosch
[...]
I have learned from Assembler over COBOL to C++ and Java, and i also understand the concept of RegEx.... but this linkCrawler rules are really a pain in the ass.
Why dont you take (at least) one day and write one wiki page with at least the most important rules and give a few examples so that everyone can help to improve this software?
Bis dato habe ich noch keine Zeit dafür gefunden. HIER anbei eine Übersicht unserer bisherigen Support-Artikel.
LinkCrawler Regeln sind ein erweitertes Feature, das keine Benutzeroberfläche hat und alleine schon deswegen eher von erfahreneren Usern verwendet wird.
Bei vielen scheitert es bereits bei den regulären Ausdrücken und einen "wie lerne ich RegEx" Kurs zu geben ist nun wirklich nicht unsere aufgabe.
Ansonsten gebe ich dir aber schon recht - es mangelt noch an Erklärungen/Beispielen für ein paar simple LinkCrawler Regeln bzw. Erklärungen der Properties.
Auch hier darfst du gerne mithelfen und/oder zumindest anmerken, welche Beispiele/Erklärungen du dir wünschen würdest.
Grüße,
pspzockerscene EDIT
Entschuldige bitte den Deutsch-Englisch Mix, aber das kommt bei uns im Forum manchmal vor^^