#1561
|
|||
|
|||
Thank you very much!
I have to replace the last two of these (three related) scripts with that new one, is it right: Is there a way to mark (by color or so) / recognize scripts belonging together in the Even Scripter?
__________________
Aktuelles Windows Last edited by Dockel; 25.10.2020 at 07:41. |
#1562
|
|||
|
|||
Yes. Correct.
|
#1563
|
|||
|
|||
OK, all done. Works great! Many thanks again!
__________________
Aktuelles Windows |
#1564
|
||||
|
||||
Quote:
__________________
JD-Dev & Server-Admin |
#1565
|
|||
|
|||
Yes, that would be great, of course! Thank you!
So here, may be a second (colored) arrow (within a column or so):
__________________
Aktuelles Windows |
#1566
|
|||
|
|||
Could someone maybe help me out please?
I am trying to make a 'new crawler job' script, but the 'var myCrawlerJob = job;' line to get the added job doesn't seem to work. it always results in an undefined variable. Thanks in advance! |
#1567
|
|||
|
|||
Appears to be working fine. Can you post the script here or provide more information it?
|
#1568
|
||||
|
||||
@Dockel: It would prefer "color picker" within the already existing edit dialog
@abrenoch: please provide your script and also what trigger you are using
__________________
JD-Dev & Server-Admin |
#1569
|
|||
|
|||
Quote:
__________________
Aktuelles Windows |
#1570
|
|||
|
|||
Quote:
Code:
// Trigger required: "New Crawler Job". var myCrawlerJob = job; function log(content) { writeFile(JD_HOME + "/log.txt", JSON.stringify(content) + "\r\n", true); } log(Date.now()) log(myCrawlerJob) 1603847718298 undefined Per the help section, it seems like I should be getting something: // ========= Properties for the EventTrigger 'New Crawler Job' ========= var myCrawlerJob = job; I'm just trying to test things at this point Last edited by abrenoch; 28.10.2020 at 02:28. |
#1571
|
||||
|
||||
Working fine here. Have you made sure to set the trigger to "New Crawler Job"?
__________________
JD-Dev & Server-Admin |
#1572
|
|||
|
|||
It is a sandbox object, and as such you cannot 'stringify' it. You have to use the corresponding object methods to access the listed properties and then write them to a file.
|
#1573
|
|||
|
|||
Quote:
I was trying that as well... But when I tried to 'getSourceUrl' I would only ever get a "cannot call method getSourceUrl of undefined". I'll try again after updating, but I had that thought as well and calling a method didn't seem to help. |
#1574
|
||||
|
||||
@abrenoch: no updates because no issues. Just tried and worked fine on first try.
Can you show a screenshot of the eventscripter extension, table/list of scripts
__________________
JD-Dev & Server-Admin |
#1575
|
|||
|
|||
Quote:
Sending the url to this forum post, for example, yielded a couple triggers but always an 'undefined' job: 1603922086067 undefined 1603922097095 undefined Thanks for the help! |
#1576
|
||||
|
||||
As mgpai already explained, you cannot JSON.stringify on the job as it is no Object/Map that supports JSON conversion.
You have to write out the fields you are interested in Quote:
__________________
JD-Dev & Server-Admin Last edited by raztoki; 29.10.2020 at 11:38. |
#1577
|
|||
|
|||
Hey guys, ive been looking to enable some sort of multi directory duplicate check, just like it is now, except multiple directories ( 2nd - 3rd ssd , external hdds ) etc. I searched a good while, came upon this thread, and have searched it. Didnt find a final solution, anyone point me in the right direction?
Thanks. |
#1578
|
|||
|
|||
Quote:
Scanning/matching entire contents of multiple drives using a script is resource intensive and time consuming. By the time a dupe is detected, the file would have triggered captcha and/or will be partially downloaded. The download locations are usually limited to certain folders. Optimal method would be to use a script to specify/scan only those folders and disable the links. Such a script can be found HERE. |
#1579
|
|||
|
|||
Hi. I've been wondering if it's possible to tidy up my download list with a script.
Is it possible to combine multiple downloaded links, with the same package name and same download directory, into a single package? I've got over 127,000 downloaded links that I keep to avoid adding duplicates. If I could combine packages and sort files within them from newest to oldest, it would look much more organized. EDIT: if matching both package name and directory is too much, I'd say grouping by directory and using its name as the package name would suffice. Last edited by GreenXIII; 04.11.2020 at 18:56. |
#1580
|
||||
|
||||
@GreenXIII: should be possible , maybe mgpai can help you with it He's the script master of the universe
__________________
JD-Dev & Server-Admin |
#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; 06.11.2020 at 23: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 16: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 | |
|
|