#1241
|
|||||
|
|||||
![]() Quote:
\\ is literally mean \ or use / For example jd will see this path 'C:\Program Files\JDownloader 2.0\JDownloader2.exe' as 'C:Program FilesJDownloader 2.0JDownloader2.exe' because it was trying to escape P from Program and J from JDownloader and J from JDownloader2.exe. So it has to be given 'C:\\Program Files\\JDownloader 2.0\\JDownloader2.exe' Or 'C:/Program Files/JDownloader 2.0/JDownloader2.exe' Quote:
In this case copy 'jdHotkey.exe' into '_bin' folder you just created Quote:
It cannot be double clicking. Just call/put hotkeyCtrlDel(); anywhere in your script as desired and use any trigger you want then Ctrl+Del will be sent to JD Quote:
Quote:
Code:
function hotkeyCtlrCancEnter() var exePath = JD_HOME + '\\_bin'; var exeCmd = 'JD-CtlrCancEnter.exe' var hotkey = getPath(exePath + "\\" + exeCmd); callSync(hotkey); } Last edited by zreenmkr; 14.03.2020 at 14:38. |
#1242
|
|||
|
|||
![]()
@zreenmkr
- create the dir "_bin" in JD_HOME dir and download / extract the file ... - create this code (botton press for test) Code:
if (name == "test") { function hotkeyCtrlDel() { var exePath = JD_HOME + '\\_bin'; var exeCmd = 'jdHotkey.exe' var hotkey = getPath(exePath + "\\" + exeCmd); callSync(hotkey, '-hkey'); } } ![]() Quote:
-the file is *.exe -in the script i say "execut this program here .." es notepad Code:
var textEditor = "notepad.exe"; callSync(textEditor); So being an .exe why shouldn't it do what it has to if I click twice on it ?? while with autohotkey I have an exe that clicked 2 times does what it should but put in the script ... it does nothing Code:
var hotkeyexe = getPath(JD_HOME + "/_bin/CtrlCancEnterJD.exe"); callSync(hotkeyexe); Code:
function hotkeyCtlrCancEnter(){ var exePath = JD_HOME + '\\_bin'; var exeCmd = 'CtrlCancEnterJD.exe' var hotkey = getPath(exePath + "\\" + exeCmd); callSync(hotkey); } |
#1243
|
|||
|
|||
![]()
@BJN01: AHK Example
AHK Script (notepad.ahk): Code:
run notepad WinWait, Untitled - Notepad WinActivate, Untitled - Notepad SendInput, %1% Send, !fs Calling the AHK Script in Eventscripter: Code:
// AHK demo var ahk = "C:\\AHK\\AutoHotkeyU32.exe"; var script = "C:\\AHK\\Scripts\\notepad.ahk"; var text = getAllDownloadLinks().map(function(link) { return [link.getPackage().getName(), link.getName(), link.getUrl()].join(", "); }).join("\n") callSync(ahk, script, text); |
#1244
|
|||
|
|||
![]()
thanks, I sign these codes and try something.
![]() at the moment I solved by creating an * .exe with autoilt + this code Code:
// send "{CTRL}{DEL} " + "{enter}" to shortkey to JD // In JD there is a command: <<clear filtered links>> ( setting\user interface\linkgrabber botton bar ..... the icon is a gray funnel) //I matched it with a shost cut (ctrl + del) // so this script is used to execute the command without having to physically press "{CTRL}{DEL} " // trigger = a download stopped -or- download controller stopped var hotkeyExe = getPath(JD_HOME + "/_bin/JDCtrlCancEnter.exe"); callSync(hotkeyExe); code nel file au3 (I don't know if something is missing or if I could avoid some things ... but it works ... so ... i use it and convert to *.exe ) Code:
WinActivate("[TITLE:JDownloader 2]") WinActive("[CLASS:SunAwtFrame]") Send("{CTRLDOWN}{DEL}{CTRLUP}") WinActivate("[TITLE:JDownloader 2]") WinActive("[CLASS:SunAwtFrame]") Send("{ENTER}") WinActivate("[TITLE:JDownloader 2]") WinActive("[CLASS:SunAwtFrame]") Exit I noticed that the command is executed even if the .exe is clicked twice (as I assumed). (I have not yet understood what was wrong with the exe obtained from autohotkey ... but I think I will lose a little more time on it ... it makes me very angry. ![]() @zreenmkr = sorry if I ask you but could you tell me what you wrote in au3? I would like to try to understand why <jdHotkey.exe> doesn't work |
#1245
|
||||
|
||||
![]() Quote:
Quote:
Quote:
Quote:
Code:
Global $titleJd = '[CLASS:SunAwtFrame; TITLE:JDownloader 2]' ;help - **External links are only visible to Support Staff** If Not WinExists($titleJd) Then Exit ; If no parameters has been entered If $CmdLine[0] = 0 Then Exit ; Checking parameter If $CmdLine[1] == "-hkey" Then ; if the parameter check out If WinActive($titleJd) Then Send('{CtrlDown}{DEL}{CtrlUp}') ;If WinActive($titleJd) Then Send('{F2}') EndIf Exit |
#1246
|
|||
|
|||
![]() Quote:
Code:
if (name == "test") { hotkeyCtrlDel() //sleep(1000) //hotkeyCtlrCancEnter() } //Function 1 function hotkeyCtrlDel() { var exePath = JD_HOME + '\\_bin'; var exeCmd = 'jdHotkey.exe'; var hotkey = getPath(exePath + "\" + exeCmd); callSync(hotkey, '-hkey'); } //Function 2 function hotkeyCtlrCancEnter() { var exePath = JD_HOME + '\\_bin'; var exeCmd = 'CtrlCancEnterJD.exe'; var hotkey = getPath(exePath + "\" + exeCmd); callSync(hotkey); } Quote:
Code:
var textEditor = "notepad.exe"; Global as the name implied, will work everywhere in any function without declaring it again. (e.g. jd environment var JD_HOME is a good example of Global., also look into global const) Code:
//notice no 'var' infront of 'textEditor' textEditor = "notepad.exe"; take another look at this example |
#1247
|
|||
|
|||
![]()
@zreenmkr = thank you !
Quote:
i have 2 question: 1) there any difference in reversing the order of title and class? Code:
Global $titleJd = '[CLASS:SunAwtFrame; TITLE:JDownloader 2]' Code:
Global $titleJd = '[TITLE:JDownloader 2;CLASS:SunAwtFrame]' Code:
If $CmdLine[1] == "-hkey" Then p.s = I'm afraid I know the answer but by chance is there a shortcut for the link grabber tab and the download tab? (ctrl+ ??) |
#1248
|
|||
|
|||
![]() Quote:
Quote:
= is assignment operator == is comparison operator Quote:
|
#1249
|
|||
|
|||
![]() Quote:
Code:
var autoitDir = 'C:\\Program Files (x86)\\AutoIt3'; var autoitExe = 'AutoIt3.exe'; //var autoitExe = 'AutoIt3_X64.exe'; var autoitPath = getPath(autoitDir + "\\" + autoitExe); var scriptDir = C:\\AU3\\Scripts' var scriptName = 'notepad.au3' var scriptPath = getPath(scriptDir + "\\" + scriptName ); callSync(autoitPath , scriptPath , [text]); |
#1250
|
|||
|
|||
![]() Quote:
![]() |
#1251
|
||||
|
||||
![]()
I need an event script that disables the hoster: After 5 captcha resolve try fails for related hoster. Could you guys help?
|
#1252
|
|||
|
|||
![]()
It is currently not possible to associate the captcha result with the download link which triggered it. You can track the total download attempts made by a link and disable related hosters based on that number.
|
#1253
|
||||
|
||||
![]()
That's a good idea but how to create such script. I don't know script language.
|
#1254
|
|||
|
|||
![]() Code:
// Disable pending links of user-specified hosts, after x retries // Trigger: A Download Stopped var myHosts = ["host.com", "host.org", "host.net"]; // <- set host names var myMaxTries = 5; // <- set max. number of retries allowed var host = link.getHost(); var totalTries = link.getSessionProperty("count") || 0; if (myHosts.indexOf(host) > -1) { if (totalTries < 5) { if (link.isEnabled()) link.setSessionProperty("count", totalTries + 1); } else if (totalTries >= 5) { link.setSessionProperty("count", 0); getAllDownloadLinks().filter(function(link2) { return link2.getHost() == host && !link2.isFinished() && !link2.getSpeed(); }).forEach(function(link3) { link3.setEnabled(false); }) } } |
#1255
|
||||
|
||||
![]() Quote:
Protecting captcha credits against endless loops: https://board.jdownloader.org/showth...821#post459821 |
#1256
|
|||
|
|||
![]()
The earlier script in only a workaround and not a proper solution for your problem. It will disable the host even if the retries are not captcha related. For this reason it is better to use it only for problemetic hosts and not for all hosts.
Script which processes all hosts: Code:
// Disable pending links of hosts, after x retries // Trigger: A Download Stopped var myMaxTries = 5; // <- set max. number of retries allowed var totalTries = link.getSessionProperty("count") || 0; if (totalTries < 5) { if (link.isEnabled()) link.setSessionProperty("count", totalTries + 1); } else if (totalTries >= 5) { link.setSessionProperty("count", 0); getAllDownloadLinks().filter(function(link2) { return link2.getHost() == link.getHost() && !link2.isFinished() && !link2.getSpeed(); }).forEach(function(link3) { link3.setEnabled(false); }) } |
#1257
|
||||
|
||||
![]() Quote:
|
#1258
|
|||
|
|||
![]()
Hello there,
I run a Linux Distro and for Linux the "Move file(s) or package(s) to trash"-function does not work. Instead they get deleted completely. A ticket has been created. Could this be solved via a script? Running: kioclient move example.mp3 trash:/ in the terminal does the job. |
#1259
|
|||
|
|||
![]()
No. That trigger does not return download link object.
|
#1260
|
|||
|
|||
![]() Quote:
Code:
/* Remove selected links and move files to trash Trigger: "Downloadlist Contextmenu Button Preseed" Customize download list context menu > Add a new "Eventscripter trigger" button > Rename it to "[Script] Remove links and move files to trash" (without quotes) > Change Icon (Optional) */ if (name == "[Script] Remove links and move files to trash") { var links = dlSelection.getLinks(); if (links.length) { links.forEach(function(link) { var file = getPath(link.getDownloadPath()); if (file.exists()) callSync("kioclient", "move", file, "trash:/"); link.remove(); }) } } |
![]() |
Thread Tools | |
Display Modes | |
|
|