#21
|
||||
|
||||
![]()
@Tyler: either wait for response here or write him a pm
![]()
__________________
JD-Dev & Server-Admin |
#22
|
|||
|
|||
![]()
Don't know if this should be posted since it's so simple, but I wanted a way of getting notifications on my phone via pushover when a package had finished. It was quite easy and using the code
Code:
postPage("**External links are only visible to Support Staff**, "token=appToken&user=userKey&message=" + package.getName() + " finished."); Works like a charm but if this thread is meant for more elaborate scripts, feel free to move or delete this post. Since I didn't find any other hints or tutorials for using pushover for jdownloader-notifications, I thought I'd just leave it here. |
#23
|
||||
|
||||
![]()
@Wicküler: your script is perfectly fine and I'm sure it will be useful for others as well
![]()
__________________
JD-Dev & Server-Admin |
#24
|
|||
|
|||
![]() Quote:
Code:
// Auto stop/restart downloads if the current average speed is below limit. // Trigger Required: "Interval" var minSpeed = 128; // (KiB/s) <- minimum average download Speed. var minDuration = 1; // (minutes) <- minimum download duration per link. var waitTime = 1; // (minutes) <- wait time before restart. if (running() && getAverageSpeed() < minSpeed * 1024) { stopDownloads(); sleep(waitTime * 60 * 1000); startDownloads(); } // Check if all downloads have been running for atleast the minimum duration. function running() { var links = getRunningDownloadLinks(); if (links.length > 0) { for (i = 0; i < links.length; i++) { var link = links[i]; if (link.getDownloadDuration() < minDuration * 60 * 1000) { return false; } } return true; } else { return false; } } |
#25
|
|||
|
|||
![]()
thank you mgpai, that works perfectly.
|
#26
|
|||
|
|||
![]()
is there any documentation i can look at for the event scripter?
|
#27
|
||||
|
||||
![]()
@Tyler
check the editor, it has doco on each method which is available. raztoki
__________________
raztoki @ jDownloader reporter/developer http://svn.jdownloader.org/users/170 Don't fight the system, use it to your advantage. :] |
#28
|
|||
|
|||
![]()
Hi mgpai, can you help me with a script to move completed downloads to a new folder? This way I can pick them up with filebot to get subtitles and place them in their proper folder.
BTW, I know packagizer can do this for compressed files but I want a solution for compressed and uncompressed files. Thanks in advance! Last edited by mrstimpy; 23.01.2017 at 06:28. Reason: Explained packagizer is not good enough |
#29
|
|||
|
|||
![]() Code:
// Move finished non-archive files, to user defined folder // Trigger required: "A Download Stopped" var destFolder = "c:/myFolder/movedFiles"; // <- Set destination folder. if (link.isFinished() && !link.getArchive()) { getPath(link.getDownloadPath()).moveTo(destFolder); } |
#30
|
|||
|
|||
![]() Quote:
is it possible to also reconnect and not just stop and restart? while testing, i realized that if i activate the speed limit in jdownloader and the speed is below the limit in your script, than it also activates the script. could you maybe add an "suspend the script code" if "speed limit" in jdownloader is active? and is there a way to make buttons for the toolbar, that actives/deactivates an specific script from the event scripter list? i tried the "activate/deactivate Event Scripter Button", but it doesn't seem to work. even if i deactivate the Event Scripter the activated scripts still run. and i have to deactivate them in the Event Scripter List in the settings tab. i think to get the "activate/deactivate Event Scripter Button" to work it needs a restart and thats not practical. thank you for your work/help :) Last edited by jdorg; 04.02.2017 at 11:51. |
#31
|
|||
|
|||
![]() Code:
// Request reconnect if the current average speed is below limit. // Trigger Required: "Interval" var minSpeed = 128; // (KiB/s) <- minimum average download Speed. var minDuration = 1; // (minutes) <- minimum download duration per link. if (running() && !limitEnabled() && getAverageSpeed() < minSpeed * 1024) { requestReconnect(); } // Check if all downloads are resumeable and have been running for atleast the minimum duration. function running() { var links = getRunningDownloadLinks(); if (links.length > 0) { for (i = 0; i < links.length; i++) { var link = links[i]; if (!link.isResumeable() || link.getDownloadDuration() < minDuration * 60 * 1000) { return false; } } return true; } return false; } // Check if Speed limit or pause is currently enabled function limitEnabled() { if (callAPI("config", "get", "org.jdownloader.settings.GeneralSettings", null, "downloadspeedlimitenabled") || isDownloadControllerPaused()) { return true; } return false; } Quote:
You are welcome ![]() Last edited by mgpai; 06.02.2017 at 13:13. Reason: Added check for non-resumeable downloads before reconnect |
#32
|
|||
|
|||
![]()
thank you for the script, but i forgot to ask if its possible to check if one or more (active/downloading) files in the download list are NOT resumable.
when there are some of them, than suspend the script and/or give a warning alert/popup that there are NOT resumable links in the list. EDIT: i just had a case that my download limit on mega filehoster was reached and the download speed was 0/nothing but there was no reconnect. what could be the reason? Last edited by jdorg; 05.02.2017 at 12:40. |
#33
|
|||
|
|||
![]() Quote:
In this case, I think the script will not be triggered at all. Instead, a reconnect (if enabled) would be performed by JD automatically. Jiaz should be able to provide more information in this regard. |
#34
|
|||
|
|||
![]()
thank you for the modification with non-resumables.
for the mega filehoster limit with no reconnect, the built-in auto reconnect of jdownloader was not activated. i thought your script would reconnect, but i will try it with the built-in auto reconnect and see if it reconnects. EDIT: built-in auto reconnect works after i have reached the download limit. but it waits until all active downloads end and get decrypted. (even with active setting to be allowed to interrupt resumable downloads for reconnect) the problem is, that most of the time the last active downloads fall down to extreme low speed and it takes hours to end the downloads. so i lose a lot of time in that jdownloader could have downloaded with max speed and it just needed one reconnect. Last edited by jdorg; 07.02.2017 at 15:22. |
#35
|
|||
|
|||
![]()
After activating 'Auto reconnect' in JD, have you disabled the script?
If there are no active downloads, and new downloads do not start due to download limit being reached, JD should perform a reconnect automatically. On the other hand, if the downloads are running and speed drops below the specified limit, the script should request a reconnect, irrespective of whether the download limit has reached or not. |
#36
|
|||
|
|||
![]()
sorry for late reply.
i tested with built-in auto reconnect only. now i tested with both activated: built-in + your script and it works. when i get limit reached "error" and download speed falls below the limit i set in your script, then it reconnects. thank you for your help and script. |
#37
|
|||
|
|||
![]()
Check for new update logs at user defined intervals and open them in notepad.
Code:
// View Update Log // Trigger Required: "Interval" // OS: Windows var int = 10; // (minutes) <- Interval between checks. if (interval == int * 60 * 1000) { var logFiles = getPath(JD_HOME + "/logs/updatehistory").getChildren(); for (i = 0; i < logFiles.length; i++) { var logFile = logFiles[i]; var age = new Date() - getPath(logFile).getModifiedDate(); if (!/self/.test(logFile) && age < int * 60 * 1000) callAsync(function() {}, "notepad.exe", logFile); } } else { interval = int * 60 * 1000; } |
#38
|
||||
|
||||
![]()
Any chance to get UUID or packagename with only "archive" (method/class) and trigger "Archive extraction finished" ?
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep. ![]() |
#39
|
|||
|
|||
![]() Quote:
Code:
var packageName = archive.getDownloadLinks()[0].getPackage().getName(); |
#40
|
||||
|
||||
![]() Quote:
![]()
__________________
JD-Dev & Server-Admin |
![]() |
Thread Tools | |
Display Modes | |
|
|