JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2181  
Old 13.05.2022, 13:27
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 62,017
Default

@Wolfin2010
You're wrong in this thread!
Please report this issue in this subforum and provide all required details such as a problem description, example links and a log.

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #2182  
Old 13.05.2022, 17:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Murxx View Post
Falls ein Paket aus mindestens zwei Teilen (files) besteht, sollte es aufgeklappt erscheinen, damit alle "Teile" sichtbar sind.
Bei nur einem enthaltenen Link reicht die Anzeige des Paketnamens völlig aus.
The script currently runs on JDownloader start and checks and expands/collapses packages based on your criteria. You can also use a different event trigger or custom button, if you want to run it more frequently.

Code:
/*
    Set package expanded state
    Trigger : JDownloader Started
*/


getAllFilePackages().forEach(function(package) {
    var single = package.downloadLinks.length == 1;

    single && package.expanded && package.setExpanded(false);
    !single && !package.expanded && package.setExpanded(true);
})
Reply With Quote
  #2183  
Old 15.05.2022, 01:58
DragoBleaPiece DragoBleaPiece is offline
Baby Loader
 
Join Date: Jun 2020
Posts: 7
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    List dupes by size
    Trigger : Toolbar button
*/

if (name == "List dupes by size") {
    var file = getPath(JD_HOME + "/tmp/dupes_by_size.htm");
    var group = {};
    var output = "";

    getAllDownloadLinks().forEach(function(link) {
        var size = link.bytesTotal
        var name = link.package.name + " - " + link.name;

        group[size] = group[size] || [];
        group[size].push(name)

    })

    for (x in group) {
        var names = group[x];

        if (names.length > 0) {
            output += x + "\r\n\t";
            output += names.sort().join("\n\t")
            output += "\r\n\r\n"
        }
    }

    if (output) {
        file.delete();
        output = "<pre>" + output + "</pre>";
        writeFile(file, output, false);
        openURL("file://" + file);
    }
}
Hi, @mgpai!
Is it possible if we grouped the links of the same size into a specified folder in the linkgrabber? For the folder name, maybe can just use the name file from the first link checked. Also is there another way to check duplicates beside of the file name and the file size?
Thank you
Reply With Quote
  #2184  
Old 15.05.2022, 08:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by DragoBleaPiece View Post
Hi, @mgpai!
Is it possible if we grouped the links of the same size into a specified folder in the linkgrabber? For the folder name, maybe can just use the name file from the first link checked.
I am guessing you mean when the links are originally added to JD.

Grouping only by size can break multi-part archives. Links belonging to different archives could end up (wrongly) in the same package. JD already tries to detect mirrors and group them in the same package. This auto-grouping feature can break if the package name is set by a custom rule.

Can you provide any example url where you want the resulting links to be grouped in the same package, but they currently end up in separate packages?

Quote:
Originally Posted by DragoBleaPiece View Post
Also is there another way to check duplicates beside of the file name and the file size?
Checksums can also be used, but unfortunately not all hosters provide them. In some cases, grouping the links by container url (originating from same url) may help.
Reply With Quote
  #2185  
Old 16.05.2022, 21:39
steveallen steveallen is offline
Vacuum Cleaner
 
Join Date: Apr 2020
Posts: 18
Default script: Move finished non-archive files, to user defined folder

In the following script:
- Is there a way to get the "PackageName" path ( instead each links path...) and move the complete PackageName ?
( in other words, move the complete sub-folder packagename )

( The below script works but the subfolder(PackageName ...package sub folder is not moved. Only files inside package are moved to destfolder.
So I am looking to find a solution to get move the complete package...)

Thanks in advance


Code:

// Move finished non-archive files, to user defined folder
// Trigger required: "A Download Stopped"

var destFolder = "D:/Jdl_Finished_packages";

if (link.isFinished() && !link.getArchive()) {
getPath(link.getDownloadPath()).moveTo(destFolder);
}
Reply With Quote
  #2186  
Old 26.05.2022, 11:13
RedNapalm RedNapalm is offline
Vacuum Cleaner
 
Join Date: Dec 2017
Posts: 16
Default

Hey I need a script that'll copy and paste the source URL to comments since we can't search through URLs. Thanks!
Reply With Quote
  #2187  
Old 26.05.2022, 18:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

@RedNapalm: what *source URL* are you referring to? In JDownloader there are several sources known, see https://support.jdownloader.org/Know...iew-added-urls
eg source can be the browser tab URL, also can be the container url or the linkshortener.
can you explain what you have in mind/what you're trying to achieve, then we can help you better.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2188  
Old 26.05.2022, 19:17
onyhow onyhow is offline
Modem User
 
Join Date: May 2022
Posts: 4
Default

Um, hi. I would like to ask for a script that would insert a folder into mega.nz folder structure if possible.

Specifically, what I'm trying to download from mega is structured in a\b\c\d. I want to insert a folder and make it like this: a\INSERT FOLDER HERE\b\c\d. The name there will be a static folder name.

Is that possible?

Thank you.
Reply With Quote
  #2189  
Old 27.05.2022, 10:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

@mgpai: see my idea https://board.jdownloader.org/showpo...36&postcount=2 for @onyhow
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2190  
Old 30.05.2022, 11:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by onyhow View Post
... insert a folder into mega.nz folder structure ...
Code:
/*
    Set download folder
    Trigger: Packagizer Hook
*/    

if (state == "AFTER" && link.host == "mega.co.nz") {
    var insert = "string";
    var folder = link.downloadFolder.split("/");

    folder.splice(1, 0, insert);
    link.downloadFolder = folder.join("/");
}
Reply With Quote
  #2191  
Old 30.05.2022, 11:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

@mgpai: don't you have to reassign to folder?
Quote:
folder=folder.splice(1, 0, insert);
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2192  
Old 30.05.2022, 11:49
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: don't you have to reassign to folder?
No. The splice() method overwrites the original array.
Reply With Quote
  #2193  
Old 30.05.2022, 11:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

Quote:
Originally Posted by mgpai View Post
No. The splice() method overwrites the original array.
Once reason why I ...don't like it :p
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2194  
Old 31.05.2022, 17:27
TomNguyen TomNguyen is offline
Super Loader
 
Join Date: Jul 2017
Posts: 29
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Randomize download order
    Trigger: Download controller started
*/

var index, priorities = ["HIGHEST", "HIGHER", "HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST"];

getAllDownloadLinks().forEach(function(link) {
    if (!link.finshed) {
        index = Math.floor(Math.random() * priorities.length);
        link.priority = priorities[index];
    }
})
Dear mgpai,
Could you please help modify this script to give HIGHEST priority for files smaller than 100MB (and if possible, give HIGHER priority for files size from 100MB to 1GB), then other files (bigger than 1GB) are random download order (random "HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST" priorities).
I want Jdownloader to download small files such as ebooks and audio files first, then movie later. Downloading big file take long wait time, especially with free download, so it would be great to get the big files later when all other small files have been downloaded.
Thank you!

Last edited by TomNguyen; 31.05.2022 at 18:05.
Reply With Quote
  #2195  
Old 31.05.2022, 18:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by TomNguyen View Post
... give HIGHEST priority for files smaller than 100MB (and if possible, give HIGHER priority for files size from 100MB to 1GB), then other files (bigger than 1GB) are random download order (random "HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST" priorities)...
Hi @ TomNguyen,

Code:
/*
    Set priority
    Trigger: Download controller started
*/

getAllDownloadLinks().forEach(function(link) {
    if (!link.finished && link.bytesTotal > -1) {
        var size = link.bytesTotal / 1e6;
        var priority = size < 100 ? "HIGHEST" : size < 1000 ? "HIGHER" : random();

        link.priority != priority && (link.priority = priority);
    }
})

function random() {
    var array = ["HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST"];
    var index = Math.floor(Math.random() * array.length);

    return array[index];
}
Reply With Quote
  #2196  
Old 31.05.2022, 19:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

@mgpai: mgpai shooting scripts as it's "The Easiest Thing in the World"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2197  
Old 01.06.2022, 03:47
TomNguyen TomNguyen is offline
Super Loader
 
Join Date: Jul 2017
Posts: 29
Default

Quote:
Originally Posted by mgpai View Post
Hi @ TomNguyen,

Code:
/*
    Set priority
    Trigger: Download controller started
*/

getAllDownloadLinks().forEach(function(link) {
    if (!link.finished && link.bytesTotal > -1) {
        var size = link.bytesTotal / 1e6;
        var priority = size < 100 ? "HIGHEST" : size < 1000 ? "HIGHER" : random();

        link.priority != priority && (link.priority = priority);
    }
})

function random() {
    var array = ["HIGH", "DEFAULT", "LOW", "LOWER", "LOWEST"];
    var index = Math.floor(Math.random() * array.length);

    return array[index];
}

It works great, script master!

Quote:
Originally Posted by Jiaz View Post
@mgpai: mgpai shooting scripts as it's "The Easiest Thing in the World"
Exactly what I wanted to say.
Thanks again, mgpai!
Reply With Quote
  #2198  
Old 01.06.2022, 12:28
onyhow onyhow is offline
Modem User
 
Join Date: May 2022
Posts: 4
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Set download folder
    Trigger: Packagizer Hook
*/    

if (state == "AFTER" && link.host == "mega.co.nz") {
    var insert = "string";
    var folder = link.downloadFolder.split("/");

    folder.splice(1, 0, insert);
    link.downloadFolder = folder.join("/");
}
Thanks, will try!

Update: It works! Thanks!

Last edited by onyhow; 01.06.2022 at 16:37. Reason: Update
Reply With Quote
  #2199  
Old 03.06.2022, 16:02
Tomrich Tomrich is offline
Junior Loader
 
Join Date: Aug 2020
Posts: 13
Default

my sc card crashed a few days ago and i had to restore an backup from 2021 where i used jdownloader without event scripter. now i can't install/enable it. i opened the webinterface of my jdownloader headless install (raspberry pi 3) and clicked to "install". now it loading and loading and loading. jdownloader was updated and restarted before.

can i install/enable event scripter using the command line?
Reply With Quote
  #2200  
Old 03.06.2022, 17:46
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 76,479
Default

@Tomrich: I would recommend to check/fix the installation, see https://support.jdownloader.org/Know...r-installation
then install the eventscripter via webinterface , hit the button, and then restart JDownloader
__________________
JD-Dev & Server-Admin
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 18:01.
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 - 2022, Jelsoft Enterprises Ltd.