#41
|
|||
|
|||
yes of course!
**External links are only visible to Support Staff**... I tried this with my username and password: Code:
//Ajoutez votre script ici. N'hésitez pas à utiliser les propriétés et méthodes de l'API disponibles. // Crawler: psyreactor.com // Trigger required: "New Crawler Job" var sourceURL = job.text; var matchURL = (/^https:\/\/psyreactor.com\/.+\/[\d-]+$/).test(sourceURL); try { if (matchURL) { var mainURL = "**External links are only visible to Support Staff**; var username = "***"; // Change username var password = "***"; // Change password var br = getBrowser(); var postURL = mainURL + "index/sub/"; var postData = "user=" + username + "&password=" + password + "&rem=1&a=2&ajax=1&rnd=691"; var mainPage = br.getPage(mainURL); var mainPage = br.postPage(postURL, postData); var links = br.getPage(sourceURL); callAPI("linkgrabberv2", "addLinks", { "links": links }); job.setText(""); } } catch (e) { alert("Error occured while adding \"" + sourceURL + "\". Please try again"); } |
#42
|
||||
|
||||
@flowlapache: URL pattern (matchURL) is different and the whole login logic is also different.
Can you send logins and example links to support@jdownloader.org The script doesn't work 1:1 without modifications because its a complete different site
__________________
JD-Dev & Server-Admin |
#43
|
|||
|
|||
ok, naively, I believed it was same logic...
thank you, since so much years you help peoples!! I send logins and examples now by email. |
#44
|
||||
|
||||
@flowlapache: thanks, will check mail and answer as soon as possible
__________________
JD-Dev & Server-Admin |
#45
|
||||
|
||||
@flowlapache
Completely without testing, I'd say it could work like this: Code:
//Ajoutez votre script ici. N'hésitez pas à utiliser les propriétés et méthodes de l'API disponibles. // Crawler: psyreactor.com // Trigger required: "New Crawler Job" var sourceURL = job.text; var matchURL = (/^https:\/\/(?:www\.)?psyreactor\.com\/viewtopic\.php\?p=[0-9]+/).test(sourceURL); try { if (matchURL) { var mainURL = "**External links are only visible to Support Staff**; var username = "TODO"; // Change username var password = "TODO"; // Change password var br = getBrowser(); var postURL = mainURL + "login.php"; var postData = "username=" + username + "&password=" + password + "&redirect=&login=Log+in"; var mainPage = br.getPage(mainURL); var mainPage = br.postPage(postURL, postData); var links = br.getPage(sourceURL); callAPI("linkgrabberv2", "addLinks", { "links": links }); job.setText(""); } } catch (e) { alert("Error occured while adding \"" + sourceURL + "\". Please try again"); } Update by jiaz: fixed/tested just replace username/password with correct ones
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download Last edited by Jiaz; 18.07.2022 at 19:26. |
#46
|
|||
|
|||
Thank you @pspzockerscene for the try. I tried it but it doesn't work.
I understand with difficulties how regexp works, for the line "var matchURL", it says there is no limit. I tried to replace [0-9]+ by [\d-]+$/ but it doesn't work too. |
#47
|
||||
|
||||
@flowlapache: I've fixed script here https://board.jdownloader.org/showpo...7&postcount=45
__________________
JD-Dev & Server-Admin |
#48
|
|||
|
|||
@Jiaz: Thank you a lot!!
It works like a charm!! Thanks again |
#49
|
||||
|
||||
@flowlapache: Thanks for the feedback and you're welcome!
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|