JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2161  
Old 29.04.2022, 16:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Dockel View Post
... add a button / menu item .... in the Menu Customizer...
Reply With Quote
  #2162  
Old 29.04.2022, 19:50
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 616
Default

Ah, that is great! Many thanks!

I did some mistake, I have it like this now:


But nothing happens.

Could the script automatically open the htm file in the standard browser / JD uses for the capchas?

And could it mark (e.g. with another color) the items being duplicates by size?
__________________
Aktuelles Windows

Last edited by Dockel; 29.04.2022 at 19:53.
Reply With Quote
  #2163  
Old 30.04.2022, 10:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Dockel View Post
... nothing happens.
Screenshot shows you have added the button to the context menu. Add it to the main toolbar. Also note, you can change the position of the button using drag 'n' drop after adding it.

Quote:
Originally Posted by Dockel View Post
Could the script automatically open the htm file in the standard browser / JD uses for the capchas?
Good Idea!

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);
    }
}

Quote:
Originally Posted by Dockel View Post
And could it mark (e.g. with another color) the items being duplicates by size?
Setting collors not (yet) supported in eventscripter.
Reply With Quote
  #2164  
Old 30.04.2022, 11:05
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 616
Default

Quote:
Screenshot shows you have added the button to the context menu. Add it to the main toolbar.
So it does not work in the context menu?

Unfortunately I am not abel to, I always get a wrong option:


Great, many thanks for the edition!

Quote:
Setting collors not (yet) supported in eventscripter.
Or bold, underlined, italic or with bigger letters or else?
__________________
Aktuelles Windows
Reply With Quote
  #2165  
Old 30.04.2022, 11:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Dockel View Post
So it does not work in the context menu?
It can also work with context menu button, but you will have to it also set it as trigger in the eventscripter drop down panel. Context menu scripts are normally used when working with link/package selection. In this case, toolbar button in more suitable.

Quote:
Originally Posted by Dockel View Post
Unfortunately I am not abel to, I always get a wrong option:
You have to add Eventscripter Trigger button NOT Eventscripter button. Former is used to execute scripts, while the latter is used to enable/disable the extension.

Quote:
Originally Posted by Dockel View Post
Or bold, underlined, italic or with bigger letters or else?
No such options currently exist.
Reply With Quote
  #2166  
Old 30.04.2022, 11:38
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 616
Default

Quote:
It can also work with context menu button, but you will have to it also set it as trigger in the eventscripter drop down panel. Context menu scripts are normally used when working with link/package selection. In this case, toolbar button in more suitable.
OK, so one cannot mark one or more packages and get the sizes sorted only of those files. Always the entire downloadlist. Good.

Quote:
You have to add Eventscripter Trigger button NOT Eventscripter button. Former is used to execute scripts, while the latter is used to enable/disable the extension.
Ah, very sorry!

Looks so now:


After clicking the new button this is shown:


I clicked OK and nothing seems to happen.

Quote:
No such options currently exist.
Or a linke above and under the dupes? Or an empty line. Or additional signs, an arrow, a ##### or ++++++ or >>>>>> or -------- or an indentation or else?
__________________
Aktuelles Windows
Reply With Quote
  #2167  
Old 01.05.2022, 13:16
makeszerosense makeszerosense is offline
I will play nice!
 
Join Date: Apr 2021
Posts: 2
Default Change ‘Gateway’ to show domain only

Hi,
I’ve never used Event Scripter before, I’m willing to learn though.

I use proxies that require username and password.

By default JDownloader displays the following in the ‘Gateway’ tab in the ‘Downloads’ section when I use a proxy:

<username>:<redacted-password>@subdomain.mydomain.com

This is fine for most users, however, my username and passwords are a huge string of characters. The problem is that I have to make the ‘Gateway’ tab very big and it takes up all of the space.

I would like the ‘Gateway’ tab to display the following instead:
Subdomain.mydomain.com

I don’t want it to show my huge username, or even the asterisk, which it displays as the password.

Can this be done? Any ideas on what I should be looking at changing?
Reply With Quote
  #2168  
Old 02.05.2022, 11:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@makeszerosense: I will change it to only contain host and not contain user/pass(asterisk) at all. Wait for next core update
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 02.05.2022 at 12:05.
Reply With Quote
  #2169  
Old 02.05.2022, 23:25
MKey MKey is offline
Baby Loader
 
Join Date: Apr 2022
Posts: 6
Default

Hi,
I have a very simple question, but I did not find the answer.
Is it possible to save the contents of the clipboard in the comment field when capturing links
Thanks
Reply With Quote
  #2170  
Old 03.05.2022, 12:56
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@MKey: Not out-of-the-box and also not recommended as it would not be the expected result. JDownloader parses the clipboard in several flavors and parses them all, so clipboard contains String representation, HTML representation, HTML selection...
Also this would increase memory usage alot!
What exactly do you have in mind? What do you really want from clipboard?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2171  
Old 04.05.2022, 18:43
makeszerosense makeszerosense is offline
I will play nice!
 
Join Date: Apr 2021
Posts: 2
Default

Quote:
Originally Posted by Jiaz View Post
@makeszerosense: I will change it to only contain host and not contain user/pass(asterisk) at all. Wait for next core update
Amazing. Thank you
Reply With Quote
  #2172  
Old 05.05.2022, 12:17
MKey MKey is offline
Baby Loader
 
Join Date: Apr 2022
Posts: 6
Default

Sorry for a long time did not come in.
When copying links to the clipboard, I also copy information with the description
And I would like this description to be attached to the package or link
Thanks
Reply With Quote
  #2173  
Old 05.05.2022, 12:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@MKey: hmm, in what format do you copy the information? you could for example add the information as anchor and similiar to this https://support.jdownloader.org/Know...ame-via-anchor but modify comment instead of name
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2174  
Old 06.05.2022, 15:39
MKey MKey is offline
Baby Loader
 
Join Date: Apr 2022
Posts: 6
Default

Thanks, this is not exactly what I need, but you gave me an idea, I'll try to do something with crawljob files.
But it would be great if you could add one more variable Event Scripter something like "getclipboard".
Thanks again.
Reply With Quote
  #2175  
Old 06.05.2022, 15:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@MKey: you can access the CrawlerJobSandbox object and there you have getText() method which contains the clipboard content that is used for that round. For example you can create a script for "Packagizer Hook", myPackagizerLink.getCrawledLink().getSourceJob()
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2176  
Old 08.05.2022, 17:20
TomNguyen TomNguyen is offline
DSL Light User
 
Join Date: Jul 2017
Posts: 33
Default

Quote:
Originally Posted by mgpai View Post
It is possible to create a script to move the finished links to a different package, but you may need to disable "GeneralSettings.movefilesifdownloaddestinationchangesenabled" in advanced settings. Else, the files on disk will also be moved, if the source and destination package ("Already Downloaded") download folders are different.



A better option would be to remove the links from the list by matching the finished date. Following script can be used to remove finished links which are older than 'x' days.

Caution: This script will remove links from the download list

Code:
// Remove finished links older than 'x' days
// Trigger : JDownloader Started

var days = 365; //<- Days to keep the finished links in list

var now = new Date();
var duration = days * 24 * 60 * 60 * 1000;

callAPI("downloadsV2", "queryLinks", {
    "finishedDate": true
}).filter(function(link) {
    return link.finishedDate;
}).forEach(function(link) {
    if (now - link.finishedDate > duration) getDownloadLinkByUUID(link.uuid).remove();
})
Dear mgpai,
Could you please help modify this script to delete all links that older than 365 days (not only delete finished links, but also delete skipped links, temporarily unavailable links, server errors 403 links,... )
I want to clear all old links so Jdownloader run faster. Thank you!

Last edited by TomNguyen; 08.05.2022 at 18:01.
Reply With Quote
  #2177  
Old 08.05.2022, 18:15
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by TomNguyen View Post
... modify this script to delete all links that older than 365 days ...
Hello TomNguyen.

Code:
/*
    Remove old links
    Trigger : JDownloader Started
*/

var days = 365;

var now = new Date();
var cutoff = days * 24 * 60 * 60 * 1000;
var linkIds = [];

getAllDownloadLinks().forEach(function(link) {
    if (now - link.addedDate > cutoff) {
        linkIds.push(link.UUID);
    }
})

if (linkIds.length) {
    callAPI("downloadsV2", "removeLinks", linkIds, []);
}
Reply With Quote
  #2178  
Old 08.05.2022, 18:46
TomNguyen TomNguyen is offline
DSL Light User
 
Join Date: Jul 2017
Posts: 33
Default

Quote:
Originally Posted by mgpai View Post
Hello TomNguyen.

Code:
/*
    Remove old links
    Trigger : JDownloader Started
*/

var days = 365;

var now = new Date();
var cutoff = days * 24 * 60 * 60 * 1000;
var linkIds = [];

getAllDownloadLinks().forEach(function(link) {
    if (now - link.addedDate > cutoff) {
        linkIds.push(link.UUID);
    }
})

if (linkIds.length) {
    callAPI("downloadsV2", "removeLinks", linkIds, []);
}
It works great!
Thank you so much for quick reply, mgpai.
Reply With Quote
  #2179  
Old 13.05.2022, 12:59
Murxx Murxx is offline
DSL User
 
Join Date: Nov 2020
Posts: 35
Default

Jiaz empfahl mir hier zu schreiben:

Das Problem ist in folgendem Test kurz beschrieben. Für einen Profi sicher schnell und einfach lösbar.
Danke im Voraus!

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.

So hatte ich das immer gehandhabt.
Beim Hinzufügen neuer Links habe ich das immer so eingestellt.

Urplötzlich änderte sich (warum auch immer, ich weiß es nicht) die Situation und jetzt habe ich das beschriebene Problem, würde aber gerne zurück.
Macht der Gewohnheit!

Es soll ja nur bei Paketen mit mindestens zwei Links passieren.

Falls ihr hier helfen könnt wäre ich euch ewig dafür dankbar.

Edit by Jiaz: Reference https://board.jdownloader.org/showthread.php?t=90573

Last edited by Jiaz; 13.05.2022 at 14:22.
Reply With Quote
  #2180  
Old 13.05.2022, 13:20
Wolfin2010 Wolfin2010 is offline
Baby Loader
 
Join Date: May 2022
Posts: 5
Question

Anyway to fix HLS stream broken? for vidmoly.to.

it use to download without any problem now it's not downloading anything.
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 11:08.
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 - 2023, Jelsoft Enterprises Ltd.