#1581
|
|||
|
|||
![]() Quote:
Code:
/* Merge download packages which have matching name and download folder, sorting links in descending order by ID. Trigger: Toolbar button pressed Customize main toolbar > Add a new "Eventscripter Trigger" button > Rename it to "Merge Packages" (case-sensitive) > Change Icon (optional) */ if (name == "Merge Packages") { getAllFilePackages().forEach(function(package) { if (package) { var packages = []; getAllFilePackages().forEach(function(package2) { if (package2.name + package2.downloadFolder == package.name + package.downloadFolder) { packages.push(package2); } }) if (packages.length > 1) { var linkIds = []; packages.forEach(function(package3) { package3.downloadLinks.forEach(function(link) { linkIds.push(link.UUID); }) }) linkIds.sort().forEach(function(linkId) { callAPI("downloadsV2", "moveLinks", [linkId], -1, package.UUID); }) } } }) } |
#1582
|
|||
|
|||
![]() Quote:
Can we use this script for enabling/disabling particular packagizer rules, not all of em? Thank you so much |
#1583
|
|||
|
|||
![]() Quote:
|
#1584
|
|||
|
|||
![]()
I don't know where should i ask about this. So, i wanna put all my download URLs after the file has been downloaded into a file (txt or smth), and for the next download, the URL should be checked first with that file containing finished download URLs
Any solution for this? Thank you |
#1585
|
|||
|
|||
![]() Quote:
I'm setting the script to start as JDownloader starts, is that correct? I'm getting a "ReferenceError: "name" is not defined (#7)" error when JD2 loads. |
#1586
|
||||
|
||||
![]()
@GreenXIII: made sure to set the correct trigger event type?
__________________
JD-Dev & Server-Admin |
#1587
|
|||
|
|||
![]()
Ok, found my mistake, had to configure the toolbar button and set the script to "Toolbar button pressed"
It's working! But it's very slow. I think it does one link per second. Isn't there a way to make it check the packagenames instead of each link at a time? EDIT: it was slow because it was running all morning and afternoon. After I restarted JD and ran it again, it got fast again. EDIT: also, it ignores uppercases/lowercases and treat them as different Last edited by GreenXIII; 07.11.2020 at 00:26. |
#1588
|
|||
|
|||
![]() Quote:
Quote:
Code:
if (package2.name + package2.downloadFolder == package.name + package.downloadFolder) { with: Code:
if ((package2.name + package2.downloadFolder).toLowerCase() == (package.name + package.downloadFolder).toLowerCase()) { |
#1589
|
|||
|
|||
![]() Quote:
Quote:
Code:
GeneralSettings.movefilesifdownloaddestinationchangesenabled Quote:
|
#1590
|
|||
|
|||
![]()
I've been using this script for restarting downloads that are too slow. It works, many sites get a faster DL speed after resuming.
But it has two flaws: I don't think it excludes non-resumable downloads. And it restarts the download way too fast. Some sites don't like that. For example, video.fc2 gets corrupted videos due to it. Code:
// Stop and restart slow links. // Trigger Required: "Interval" (Recommended: 30000 or more). // IMPORTANT: Enable "Synchronous execution of script" (checkbox). var minSpeed = 500; // (KiB/s) <- minimum download speed per link. var minDuration = 1; // (minutes) <- minimum download duration per link. var links = getRunningDownloadLinks(); for (i = 0; i < links.length; i++) { var link = links[i]; if (link.getDownloadDuration() < minDuration * 60 * 1000) continue; if (link.getSpeed() > minSpeed * 1024) continue; link.abort(); sleep(30000); //I've added this, but it's not working } 1) Go to another download and come back after that to the current one; 2) Have a longer timer between retrying the current download. I haven't tried a non-resumable download yet, but if the script doesn't ignore those, I'd like it to do so. |
#1591
|
|||
|
|||
![]() Code:
/* Skip/Unskip resumable links, based on user-specified speed and duration Trigger: Interval (Recommended 60000 or more) */ var links = []; getRunningDownloadLinks().forEach(function(link) { if ( link.resumeable && link.downloadDuration > 60 * 1000 && // minimum download duration (milliseconds) link.speed < 500 * 1024 // minimum speed (bytes) ) { link.skipped = true; links.push(link); } }) if (links.length) { sleep(30000); // time to wait before unskipping links (milliseconds); links.forEach(function(link) { link.skipped = false; }) } |
#1592
|
|||
|
|||
![]()
is there a script that when a download speed drops at 130kbs, it can stop all downloads and immediately restart them?
i found one but it takes time to stop and restart im downloading from a site that has only a 64~kbps per download(max 2) BUT when the download starts, it starts with max speed and drops. Meaning, when i start the download its 6-7Mbps and it gradually drops to 130kbps . So i need a script that when it drops at that, it stop and restarts asap. the one im using it takes a couple of minutes to restart Last edited by Rodark; 11.11.2020 at 17:12. |
#1593
|
|||
|
|||
![]()
Which script did you use? Stopping downloads usually takes a few seconds.
|
#1594
|
|||
|
|||
![]() Quote:
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; } } thats the one im using. found it on another page/thread it isnt instant for me, it takes a little time to restart. so currently im manually stop/restarting. can it be modified to stop and restart on the spot if the speed is less than 140 kbps? |
#1595
|
|||
|
|||
![]() Quote:
Code:
/* Restart download links if the current average speed is less than user-specified speed Trigger Required: Interval (Recommended 30000 or more) */ var minSpeed = 140, // (KiB/s) <- minimum average download Speed minDuration = 60, // (seconds) <- minimum download duration per link running = getRunningDownloadLinks().every(function(link) { return link.downloadDuration > minDuration * 1000; }); if (running && getAverageSpeed() < minSpeed * 1024) { getRunningDownloadLinks().forEach(function(link) { link.abort(); }) } |
#1596
|
|||
|
|||
![]() Quote:
|
#1597
|
|||
|
|||
![]() Quote:
The download will usually require a few seconds to reach max speed. Experiment with different values and keep them large enough to prevent false stop/start loops. |
#1598
|
|||
|
|||
![]()
thanks for the info mate!
|
#1599
|
|||
|
|||
![]() Quote:
Code:
java.lang.NullPointerException at org.jdownloader.extensions.eventscripter.ScriptThread$1.compare(ScriptThread.java:301) at org.jdownloader.extensions.eventscripter.ScriptThread$1.compare(ScriptThread.java:298) at java.base/java.util.Arrays.mergeSort(Arrays.java:1338) at java.base/java.util.Arrays.mergeSort(Arrays.java:1350) at java.base/java.util.Arrays.mergeSort(Arrays.java:1350) at java.base/java.util.Arrays.mergeSort(Arrays.java:1349) at java.base/java.util.Arrays.mergeSort(Arrays.java:1350) at java.base/java.util.Arrays.mergeSort(Arrays.java:1350) at java.base/java.util.Arrays.legacyMergeSort(Arrays.java:1317) at java.base/java.util.Arrays.sort(Arrays.java:1304) at java.base/java.util.ArrayList.sort(ArrayList.java:1721) at java.base/java.util.Collections.sort(Collections.java:179) at org.jdownloader.extensions.eventscripter.ScriptThread.cleanupClasses(ScriptThread.java:298) at org.jdownloader.extensions.eventscripter.ScriptThread.executeScipt(ScriptThread.java:178) at org.jdownloader.extensions.eventscripter.ScriptThread.run(ScriptThread.java:160) |
#1600
|
||||
|
||||
![]()
@little: please create a log, see https://support.jdownloader.org/Know...d-session-logs
and post logID here
__________________
JD-Dev & Server-Admin |
![]() |
Thread Tools | |
Display Modes | |
|
|