#1
|
|||
|
|||
Ereignismanager: Kann ich Punktestand bei einem CES abfragen und dann Aktion auslösen
Hallo,
ist es möglich bei einem bestimmten Guthabenstand bei einem CES das als Ereignis zu definieren und dann eine Aktion auszulösen? Konkretes Vorhaben1: Wenn Guthaben bei 9kw unter 100, deaktiviere 9kw-Solver Konkretes Vorhaben2: Wenn Guthaben bei CBH unter 50, deaktiviere alle Downloads die Captcha benötigen (diese gibt es als Einstellung bereits im JD) Danke
__________________
-- Viele Grüße BlackSun |
#2
|
||||
|
||||
EventTrigger: After Captcha Challenge (Ist neu.. wird im laufe des Nachmittags released)
Code:
var apiKey = "DEIN_API_KEY"; var credits = getPage("**External links are only visible to Support Staff** + apiKey); if (credits < 50) { callAPI("config", "set", "jd.controlling.captcha.CaptchaSettings", null, "captchamode", "SKIP_ALL"); }
__________________
|
#3
|
||||
|
||||
Quote:
Code:
// CES Aktion mit Prüfung vom Guthabenstand // Trigger Required: Interval var min_credits = 100; var settings_9kw = "org.jdownloader.captcha.v2.solver.solver9kw.Captcha9kwSettings"; var apikey = callAPI("config", "get", settings_9kw, null, "ApiKey"); var prio = callAPI("config", "get", settings_9kw, null, "prio"); var confirm = callAPI("config", "get", settings_9kw, null, "confirm"); var https = callAPI("config", "get", settings_9kw, null, "https"); var credits_page = '://www.9kw.eu/index.cgi?action=usercaptchaguthaben&apikey=' + apikey; var credits; if (https == 1) { credits = getPage("https" + credits_page); } else { credits = getPage("http" + credits_page); } if (credits.match(/^\d+$/)) { if (parseInt(credits) < min_credits) { callAPI("config", "set", "jd.controlling.captcha.CaptchaSettings", null, "captchamode", "SKIP_ALL"); //setDownloadsPaused(true); } else { callAPI("config", "set", "jd.controlling.captcha.CaptchaSettings", null, "captchamode", "NORMAL"); //setDownloadsPaused(false); } }
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. |
#4
|
|||
|
|||
2 Fragen:
- in welchem Interval wird geprüft und lässt sich der Wert des Intervals einstellen - muss im Skript der API-Key eingetragen werden, oder wird dieser aus den Einstellungen des 9kw-Plugin genommen?
__________________
-- Viele Grüße BlackSun |
#5
|
||||
|
||||
Quote:
Der API-Key wird aus dem JDownloader ausgelesen.
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. |
#6
|
|||
|
|||
stimmt, da war ich blind
was sollte eigentlich genau passieren? deaktiviert sich dann der 9kw-Solver, sprich verschwindet das aktiviert häkchen, oder werden nur intern keine Captchas mehr an 9kw gesendet? Diese Prüfung im Event-Manager, wird diese erst mit einem Download gestartet, oder läuft die immer auch ohne Downloads? Ausserdem scheint es noch ein anderes Problem zu geben. Wenn ich im Skipt einen höheren Credit-Stand eingebe und dann einen Download von z.B. Share-Online starte, dann werden alle Captcha-Eingaben mit "Captcha-Eingabe erforderlich" übersprungen. Ich habe aber auch noch andere Solver, sei es andere CES als auch "Dialogfenster", "Dialogfenster Browser" und "myJD". Das Skript sollte eigentlich nur dafür sorgen dass entweder nichts mehr an den 9kw-CES geht bzw. dieser Solver deaktiviert wird, nicht aber dass andere Solver beeinflusst werden. Ich denke das "skip all" im Skript ist falsch.
__________________
-- Viele Grüße BlackSun Last edited by blacksun; 10.06.2019 at 13:46. |
#7
|
||||
|
||||
Das obige Beispiel setzt nur alle Captchas auf überspringen, wenn zu wenig Guthaben erkannt wurde.
Quote:
Quote:
Quote:
Quote:
Ja, wenn es so gewünscht wird. Das "skip all" gilt für jegliche Captchas. Neues Beispiel: Code:
// CES Aktion mit Guthabenstand (nur 9kw.eu) // Trigger Required: Interval var min_credits = 50; var settings_9kw = "org.jdownloader.captcha.v2.solver.solver9kw.Captcha9kwSettings"; var apikey = callAPI("config", "get", settings_9kw, null, "ApiKey"); var prio = callAPI("config", "get", settings_9kw, null, "prio"); var confirm = callAPI("config", "get", settings_9kw, null, "confirm"); var https = callAPI("config", "get", settings_9kw, null, "https"); var credits_page = '://www.9kw.eu/index.cgi?action=usercaptchaguthaben&apikey=' + apikey; var credits; if (isDownloadControllerRunning()) { if (https == 1) { credits = getPage("https" + credits_page); } else { credits = getPage("http" + credits_page); } if (credits.match(/^\d+$/)) { if (parseInt(credits) < min_credits) { callAPI("config", "set", settings_9kw, null, "enabledglobally", false); } else { callAPI("config", "set", settings_9kw, null, "enabledglobally", true); } } }
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. |
#8
|
||||
|
||||
@thecoder2012: Danke fürs Helfen und Scripten
__________________
JD-Dev & Server-Admin |
Thread Tools | |
Display Modes | |
|
|