#1681
|
|||
|
|||
HTML Code:
// Skip slow links and resume them after wait time.
// Trigger Required: "Interval" (Recommended: 30000 or more).
// IMPORTANT: Enable "Synchronous execution of script" (checkbox).
var minSpeed = 628; // (KiB/s) <- minimum download speed per link.
var minDuration = 1; // (minutes) <- minimum download duration per link.
var waitTime = 5; // (minutes) <- wait time before restart
//alert(myPackagizerLink);
var links = getRunningDownloadLinks();
var skipped = [];
for (i = 0; i < links.length; i++) {
var link = links[i];
if (link.getDownloadDuration() < 20000) continue;
if (link.getSpeed() > minSpeed * 1024) continue;
link.setSkipped(true);
skipped.push(link.getUUID());
}
if (skipped.length > 0) {
sleep(10000);
resumeLinks();
}
//functions
function resumeLinks() {
forcestart(packednameS="Films","MyISO","mypackage2")
callAPI("downloadsV2", "resumeLinks", skipped, []);
while (isDownloadControllerStopping()) sleep(1000);
if (!isDownloadControllerRunning()) startDownloads();
}
forcestart(packedname="Films") code... etc... no all downloads start. only my package with named "Films" force start.. Last edited by drjs5x; 02.04.2021 at 13:29. |
#1682
|
|||
|
|||
yes 30 minutes force start my package named "Films "
i have got a package named "Films ". how can script a package with name force start with interval 30 minutes. forcestart(packedname="Films") code... etc... no all downloads start. only my package with name force start.. sory my bad english.. sincerely. Last edited by drjs5x; 31.03.2021 at 19:27. |
#1683
|
|||
|
|||
how can code only my packages with names force start?
forcestart(packednameS="Films","MyISO","mypackage2") code... etc...
no all downloads start. only my packages with names force start.. how can code only my packages with names force start? |
#1684
|
|||
|
|||
Any particular reason the the downloads have to be force-started at such short intervals using a script?
If the downloads are failing to start or are not completed due to plugin issues it is better to ask the developers check/fix it rather than use workaround such as this. Else, the script will simply try to start the downloads in an endless loop if the downloads fails to really start. |
#1685
|
|||
|
|||
Quote:
Sincerely. |
#1686
|
|||
|
|||
Quote:
|
#1687
|
|||
|
|||
for slow download restart downloads... but only my packets..
my event project // Skip slow links and resume them after wait time. // Trigger Required: "Interval" (Recommended: 30000 or more). // IMPORTANT: Enable "Synchronous execution of script" (checkbox). var minSpeed = 628; // (KiB/s) <- minimum download speed per link. var minDuration = 1; // (minutes) <- minimum download duration per link. var waitTime = 5; // (minutes) <- wait time before restart //alert(myPackagizerLink); var links = getRunningDownloadLinks(); var skipped = []; for (i = 0; i < links.length; i++) { var link = links[i]; if (link.getDownloadDuration() < 20000) continue; if (link.getSpeed() > minSpeed * 1024) continue; link.setSkipped(true); skipped.push(link.getUUID()); } if (skipped.length > 0) { sleep(10000); resumeLinks(); } //functions function resumeLinks() { forcestart(packednameS="Films","MyISO","mypackage2") callAPI("downloadsV2", "resumeLinks", skipped, []); while (isDownloadControllerStopping()) sleep(1000); if (!isDownloadControllerRunning()) startDownloads(); } |
#1688
|
|||
|
|||
Code:
/* Restart slow links Trigger : Interval */ var packages = ["Films", "MyISO", "mypackage2"]; var target = 128; // kbps getRunningDownloadLinks().forEach(function(link) { if ( packages.indexOf(link.package.name) > -1 && link.downloadDuration > 60000 && link.speed < target * 1024 ) { link.abort(); } }) |
#1689
|
|||
|
|||
Hi I'm trying to find away to configure the extractor to only extract files and ignore folder paths within the archive. I've been told one solution might be to use an event script to move all extracted files into the root folder (that the archive was extracted to).
I've tried to get this to work by playing around with the Extractor, Packagizer, and even Advanced Settings but can't seem to figure out a solution to what seems to be a straightforward issue. I want to automatically extract my rar archives to a <packagename> subfolder, but only extract the files themselves, and ignore the folder structure inside the rar. In the free version of WinRar there's a toggle setting called "Do not extract paths" that does exactly what I want. However I can't find the equivalent feature in JDownloader's .rar Extractor. Please let me know if there's a way to do this, and thanks in advance! |
#1690
|
|||
|
|||
Packagizer has an option to move files after extraction. You an use the <jd:packagename> placeholder in the "Move to" field.
|
#1691
|
|||
|
|||
Can you help me with a script? I want to extract the links from:
**External links are only visible to Support Staff**... but do not know how. Can you help with this? Thanks! @mgpai: https://board.jdownloader.org/showpo...7&postcount=41 Last edited by Jiaz; 16.04.2021 at 17:59. Reason: added link |
#1692
|
|||
|
|||
Seeing that the final links/file ids are generated only on click, I am not sure it is possible to extract them with just an eventescripter script.
|
#1693
|
|||
|
|||
according to :https://board.jdownloader.org/showth...707#post482707
Jiaz's Avatar Jiaz Jiaz is offline JD Manager Join Date: Mar 2009 Location: Germany Posts: 69,660 Default @eagleg: I'm sorry but there are no links you can copy to clipboard, as they are handled on leftclick via javascript Should be possible with little script for Eventscripter, see https://board.jdownloader.org/showthread.php?t=70525 that listens to "new crawl job" and then loads website, parses the file ids and fetches every link. maybe mgpai can help you with such a script, ask in that thread __________________ JD-Dev & Server-Admin |
#1694
|
||||
|
||||
Should be possible, you can parse the ids and just need a post to the url ad response contains json with final url
__________________
JD-Dev & Server-Admin |
#1695
|
|||
|
|||
ive never done this before, can you help?
|
#1696
|
|||
|
|||
Example?
|
#1697
|
||||
|
||||
@mgpai: contact me by mail
__________________
JD-Dev & Server-Admin |
#1698
|
|||
|
|||
Hello there,
Can you make an event to create info-file with package download links when download start if it's not available and not wait until it finishes The already available "Create an Info-File in the Download-Folder with detailed information" only creates it when download finishes and doesn't work all the time even after modifying the line var iContent = 0; //setting bit 1 if (bWriteFile == true && iContent > 0) { //comment out or set "iContent >= 0" if info-file should be written always Thanks |
#1699
|
|||
|
|||
Most of the information written by the script is available only after the package is finished and not when it is started. It is better to create a new script which writes only the information which is available when the package is started.
|
#1700
|
|||
|
|||
Quote:
Is there a way to use a palceholder for that directory path? Whatever the input is when the user is pasting links in the linkgrabber? |
#1701
|
|||
|
|||
Quote:
Code:
/* Move extracted files Trigger : Archive extraction finished */ archive.extractedFilePaths.forEach(function(filePath) { filePath.moveTo(archive.folder); filePath.parent.delete(); }) |
#1702
|
|||
|
|||
Quote:
Code:
/* Add cover art Trigger : Package finished */ var links = package.downloadLinks.filter(function(link) { return link.host == "soundcloud.com" && getPath(link.downloadPath).extension == "mp3"; }) if (links.length) { var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath"); links.forEach(function(link) { var cover = getPath(link.downloadPath.replace(/_\d{9}/, "_original_").replace(/mp3$/, "jpg")); if (cover.exists()) { var input = link.downloadPath; var output = input + ".mp3"; callAsync(function(exitCode) { if (exitCode == 0) { getPath(input).delete(); getPath(output).renameTo(input); } }, ffmpeg, "-hide_banner", "-i", input, "-i", cover, "-map", "0:0", "-map", "1:0", "-c", "copy", output); } }) } |
#1703
|
|||
|
|||
Hi,
I'm trying to replace spaces in filenames with an underscore within the LinkGrabber to enable mirror detection. However, my current script doesn't work: Code:
myCrawledLink.setName(myCrawledLink.name.replace(/\s/g, "_")) |
#1704
|
|||
|
|||
When do yo want to replace them? Before or after they are added to linkgrabber? You have to use a trigger/link type accordingly.
|
#1705
|
|||
|
|||
Before they get added to the download tab. Then they will have identical names, enabling mirror detection to work just based on filme names.:)
|
#1706
|
|||
|
|||
Quote:
Quote:
Code:
/* Replace space with underscore in filenames Trigger : Packagizer Hook */ try { if (state == "BEFORE") { link.setName(link.name.replace(/\s/g, "_")); } } catch (e) {}; |
#1707
|
|||
|
|||
Works like a charm, thank you very much!
|
#1708
|
||||
|
||||
@mgpai: You have a solution for every problem how about a script for world peace?
__________________
JD-Dev & Server-Admin |
#1709
|
|||
|
|||
Hello everyone
I'm looking for a script for my problem. Maybe someone can help me. I have a lots of packages with xGB and xfiles. The script is supposed to extract only one file with all parts and stop the download in order to start again afterwards. for example: file_01.part1 file_01.part2 file_01.part3 <download done <stop download <start extract <extract done <start download file_02.part1 file_02.part2 ... ... Is that possible? I will be very happy if someone helps me. Sorry for my english |
#1710
|
||||
|
||||
@qwerti: why extract one by one? JDownloader will download the files and extract as possible
__________________
JD-Dev & Server-Admin |
#1711
|
|||
|
|||
Quote:
Very large packets quickly get stuck because the SSD is full and cannot be extracted. I can't think of a better solution. Edit: I've experimented with download limits. However, it does not always work properly and not at full speed. Last edited by qwerti; 11.05.2021 at 15:18. |
#1712
|
|||
|
|||
@qwerti: Try this. It is a pretty complex workaround, but should fairly achieve your objective.
It will ensure that only one package is active (download order/sequence of packages may differ) at any give time (by skipping others). Will start the next package only after the current package is finished and any running extractions have stopped. Code:
/* Limit running packages Trigger : A Download Started */ var first = getRunningDownloadPackages()[0]; getAllFilePackages().forEach(function(package) { if (!package.finished && package.UUID != first.UUID) { package.downloadLinks.forEach(function(link) { link.skipped = true; }) } }) Code:
/* Start pending downloads after extraction is finished Trigger : Download Controller Stopped */ while (callAPI("extraction", "getQueue").length) { sleep(1000); } getAllFilePackages().some(function(package) { return !package.finished; }) && startDownloads(); If you have alternative solutions in mind or need any modifications to the current scripts, you can find me in JD Chat. Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader |
#1713
|
||||
|
||||
@mgpai: an alternative idea, interval checks for ongoing extraction and in case of yes, it stops the downloads and then starts downloads again. or *pause* new downloads
for example trigger is startdownload -> check for ongoing extraction, loop and wait till extraction is finished. I think this might even be better/easier solution
__________________
JD-Dev & Server-Admin |
#1714
|
|||
|
|||
Quote:
|
#1715
|
||||
|
||||
@mgpai: just an idea but you are right, didn't think about the packages
__________________
JD-Dev & Server-Admin |
#1716
|
|||
|
|||
It can always be something which has not occurred to me. So keep them coming.
|
#1717
|
|||
|
|||
Hello mgpai,
I am very grateful for the quick help. Thanks for the script. It works great in the following cases. Package one --> 11,37 GB Package tow --> 7,86 GB Package x --> x GB Is it possible to modify it like this? Package one --> 342,23 GB Package one.1 (11 rar-parts) --> 10,31 GBI don't know how to explain it better. I'm sorry |
#1718
|
||||
|
||||
@qwerti: In case you are talking about sub-packages, those are not supported.
__________________
JD-Dev & Server-Admin |
#1719
|
|||
|
|||
Quote:
Das der JDownloader keine sub-packages unterstützt weiß ich. Ich hab halt sehr oft das Problem das ich in einem package mehrere Dateien habe und die Pakete dadurch locker über mehrere hundert GB groß sind. Mein Speicherplatz auf der SSD ist aber nur knapp 60 GB groß ich kann also bei sehr großen Paketen nicht erst das ganze Paket laden, um es dann zu entpacken. Tut mir leid, wenn ich etwas falsch verstehe und für das deutsch :/ |
#1720
|
|||
|
|||
Replace "Limit running packages" script with this one. Please note, the script uses a different trigger. Also remember to disable "Synchronous execution of script" checkbox in the top panel of the script editor.
Code:
/* Limit running links/archives Trigger : Download Controller Started Important: Disable Synchronous execution of script checkbox in the top panel */ while (!getRunningDownloadLinks().length) { sleep(1000); } var first = getName(getRunningDownloadLinks()[0]); getAllDownloadLinks().forEach(function(link) { if (!link.finished && getName(link) != first) { link.skipped = true; } }) function getName(link) { try { return link.archive.name; } catch (e) { return link.name; } } |
Thread Tools | |
Display Modes | |
|
|