JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1681  
Old 31.03.2021, 19:14
drjs5x drjs5x is offline
Baby Loader
 
Join Date: Nov 2015
Posts: 8
Default

Quote:
Originally Posted by Jiaz View Post
@drjs5x:
You mean wait 30 secs before each download in package x ?

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")

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.
Reply With Quote
  #1682  
Old 31.03.2021, 19:20
drjs5x drjs5x is offline
Baby Loader
 
Join Date: Nov 2015
Posts: 8
Default

Quote:
Originally Posted by Jiaz View Post
@drjs5x:
You mean wait 30 secs before each download in package x ?
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.
Reply With Quote
  #1683  
Old 01.04.2021, 11:52
drjs5x drjs5x is offline
Baby Loader
 
Join Date: Nov 2015
Posts: 8
Default 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?
Reply With Quote
  #1684  
Old 02.04.2021, 08:08
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by drjs5x View Post
how can code only my packages with names force start?
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.
Reply With Quote
  #1685  
Old 02.04.2021, 08:54
drjs5x drjs5x is offline
Baby Loader
 
Join Date: Nov 2015
Posts: 8
Default

Quote:
Originally Posted by mgpai View Post
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.
yes . there is. i dont want start all downloads. i want only start only my packages with names.
Sincerely.
Reply With Quote
  #1686  
Old 02.04.2021, 13:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by drjs5x View Post
yes . there is. i dont want start all downloads. i want only start only my packages with names.
Sincerely.
It doesn't really answer my question.

Quote:
Originally Posted by mgpai View Post
Any particular reason the the downloads have to be force-started at such short intervals using a script?
Reply With Quote
  #1687  
Old 02.04.2021, 13:28
drjs5x drjs5x is offline
Baby Loader
 
Join Date: Nov 2015
Posts: 8
Default

Quote:
Originally Posted by mgpai View Post
It doesn't really answer my question.
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();
}
Reply With Quote
  #1688  
Old 02.04.2021, 13:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by drjs5x View Post
for slow download restart downloads... but only my packets..
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();
    }
})
Reply With Quote
  #1689  
Old 14.04.2021, 09:34
ThatGuy ThatGuy is offline
Baby Loader
 
Join Date: Feb 2021
Posts: 5
Default

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!
Reply With Quote
  #1690  
Old 14.04.2021, 09:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by ThatGuy View Post
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.
Packagizer has an option to move files after extraction. You an use the <jd:packagename> placeholder in the "Move to" field.
Reply With Quote
  #1691  
Old 16.04.2021, 17:55
eagleg eagleg is offline
Tornado
 
Join Date: Apr 2016
Posts: 236
Default

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
Reply With Quote
  #1692  
Old 16.04.2021, 18:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by eagleg View Post
Can you help me with a script? I want to extract the links ...
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.
Reply With Quote
  #1693  
Old 16.04.2021, 18:29
eagleg eagleg is offline
Tornado
 
Join Date: Apr 2016
Posts: 236
Default

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
Reply With Quote
  #1694  
Old 16.04.2021, 18:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

Quote:
Originally Posted by mgpai View Post
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.
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
Reply With Quote
  #1695  
Old 16.04.2021, 18:32
eagleg eagleg is offline
Tornado
 
Join Date: Apr 2016
Posts: 236
Default

ive never done this before, can you help?
Reply With Quote
  #1696  
Old 16.04.2021, 18:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
Should be possible, you can parse the ids and just need a post to the url ad response contains json with final url
Example?
Reply With Quote
  #1697  
Old 16.04.2021, 18:50
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@mgpai: contact me by mail
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1698  
Old 20.04.2021, 19:46
sherif011 sherif011 is offline
Super Loader
 
Join Date: Jul 2018
Posts: 29
Default

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
Reply With Quote
  #1699  
Old 21.04.2021, 09:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by sherif011 View Post
... create info-file with package download links when download start if it's not available and not wait until it finishes ...
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.
Reply With Quote
  #1700  
Old 24.04.2021, 06:36
ThatGuy ThatGuy is offline
Baby Loader
 
Join Date: Feb 2021
Posts: 5
Default

Quote:
Originally Posted by mgpai View Post
Packagizer has an option to move files after extraction. You an use the <jd:packagename> placeholder in the "Move to" field.
This is close to what I want. The problem here is that it only extracts files to the default download directory. I want it to extract to the download directory you set when you enter URLs to the linkgrabber.

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?
Reply With Quote
  #1701  
Old 24.04.2021, 08:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by ThatGuy View Post
... extract to the download directory you set when you enter URLs to the linkgrabber
Code:
/*
    Move extracted files
    Trigger : Archive extraction finished
*/    

archive.extractedFilePaths.forEach(function(filePath) {
    filePath.moveTo(archive.folder);
    filePath.parent.delete();
})
Reply With Quote
  #1702  
Old 01.05.2021, 13:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by epikk View Post
... how can an mp3 be saved along with its picture (cover picture) from Soundcloud?
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);
        }
    })
}
Reply With Quote
  #1703  
Old 04.05.2021, 13:03
namyar namyar is offline
JD Beta
 
Join Date: Apr 2016
Posts: 51
Question

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, "_"))
It seems "myCrawledLink" has to be defined in some way, but I'm unsure how:confused:
Reply With Quote
  #1704  
Old 04.05.2021, 13:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by namyar View Post
I'm trying to replace spaces in filenames with an underscore within the LinkGrabber to enable mirror detection.
When do yo want to replace them? Before or after they are added to linkgrabber? You have to use a trigger/link type accordingly.
Reply With Quote
  #1705  
Old 04.05.2021, 13:15
namyar namyar is offline
JD Beta
 
Join Date: Apr 2016
Posts: 51
Default

Quote:
Originally Posted by mgpai View Post
When do yo want to replace them? Before or after they are added to linkgrabber? You have to use a trigger/link type accordingly.
Before they get added to the download tab. Then they will have identical names, enabling mirror detection to work just based on filme names.:)
Reply With Quote
  #1706  
Old 04.05.2021, 13:43
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by namyar View Post
Before they get added to the download tab. Then they will have identical names, enabling mirror detection to work just based on filme names.:)
Quote:
Originally Posted by mgpai View Post
When do yo want to replace them? Before or after they are added to linkgrabber? You have to use a trigger/link type accordingly.
This script will replace the characters just before they are added to linkgrabber list. If you want to replace them after they are added to JD, you will have to use a different script with context-menu button pressed trigger.

Code:
/*
    Replace space with underscore in filenames
    Trigger : Packagizer Hook
*/

try {
    if (state == "BEFORE") {
        link.setName(link.name.replace(/\s/g, "_"));
    }
} catch (e) {};
Reply With Quote
  #1707  
Old 04.05.2021, 14:38
namyar namyar is offline
JD Beta
 
Join Date: Apr 2016
Posts: 51
Talking

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Replace space with underscore in filenames
    Trigger : Packagizer Hook
*/

try {
    if (state == "BEFORE") {
        link.setName(link.name.replace(/\s/g, "_"));
    }
} catch (e) {};
Works like a charm, thank you very much!
Reply With Quote
  #1708  
Old 04.05.2021, 14:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@mgpai: You have a solution for every problem how about a script for world peace?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1709  
Old 11.05.2021, 14:42
qwerti qwerti is offline
Modem User
 
Join Date: May 2021
Posts: 4
Default

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
Reply With Quote
  #1710  
Old 11.05.2021, 15:05
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@qwerti: why extract one by one? JDownloader will download the files and extract as possible
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1711  
Old 11.05.2021, 15:14
qwerti qwerti is offline
Modem User
 
Join Date: May 2021
Posts: 4
Default

Quote:
Originally Posted by Jiaz View Post
@qwerti: why extract one by one? JDownloader will download the files and extract as possible
I have a small SSD. The files are downloaded on the SSD and then extracted to cloud storage.
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.
Reply With Quote
  #1712  
Old 11.05.2021, 16:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

@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
Reply With Quote
  #1713  
Old 11.05.2021, 17:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@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
Reply With Quote
  #1714  
Old 11.05.2021, 17:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by qwerti View Post
Very large packets quickly get stuck because the SSD is full and cannot be extracted.
Quote:
Originally Posted by Jiaz View Post
@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
Had already considered it, but if the number of running packages are not limited it can result in multiple packages running simultaneously and filling up the SSD. While the proposed solution does not eliminate that possibility completely, it should be fairly successful in limiting the SSD usage most of the time.
Reply With Quote
  #1715  
Old 11.05.2021, 17:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@mgpai: just an idea but you are right, didn't think about the packages
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1716  
Old 11.05.2021, 18:45
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: just an idea
It can always be something which has not occurred to me. So keep them coming.
Reply With Quote
  #1717  
Old 12.05.2021, 15:29
qwerti qwerti is offline
Modem User
 
Join Date: May 2021
Posts: 4
Default

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 GB
Package one.2 (12 rar-parts) --> 11,96 GB
Package one.x (x rar-parts) --> x GB
I don't know how to explain it better. I'm sorry
Reply With Quote
  #1718  
Old 12.05.2021, 15:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,286
Default

@qwerti: In case you are talking about sub-packages, those are not supported.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1719  
Old 12.05.2021, 15:51
qwerti qwerti is offline
Modem User
 
Join Date: May 2021
Posts: 4
Default

Quote:
Originally Posted by Jiaz View Post
@qwerti: In case you are talking about sub-packages, those are not supported.
Vielleicht kurz auf Deutsch, mein Englisch ist echt mies.
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 :/
Reply With Quote
  #1720  
Old 12.05.2021, 17:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by qwerti View Post
Is it possible to modify it like this?
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;
    }
}
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 16:51.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.