JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 19.02.2025, 16:26
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default Remove duplicate links from download list

I need some help regarding the following situation :

Somehow i´ve got several duplicate links in the download list and I tried to remove those who are added later except for those which are in a deactivated package, but i do not find the correct if-clause to filter the links properly.

I got this script from a helpful admin, @mgpai maybe you an help me with this

var urls = []; getAllDownloadLinks().forEach(function(link) {
var url = link.contentURL || link.pluginURL;

if (urls.indexOf(url) == -1) {
urls.push(url);
} else {
link.remove();
}
})
Reply With Quote
  #2  
Old 19.02.2025, 17:53
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,326
Default

@PicardHSV: What does not work with this script?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 19.02.2025, 19:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,692
Default

Code:
var urls = [];

getAllDownloadLinks().forEach(function(link) {
    var url = link.contentURL || link.pluginURL;

    if (urls.indexOf(url) == -1) {
        urls.push(url);
    } else {
        link.enabled && link.remove();
    }
})
Reply With Quote
  #4  
Old 19.02.2025, 19:23
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default it works

Quote:
Originally Posted by Jiaz View Post
@PicardHSV: What does not work with this script?
but I forgot about the disabled packages
Reply With Quote
  #5  
Old 21.02.2025, 17:27
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default Thanx and a question regarding CPU usage

The script seems to work, but right now it let the computer hung, you cannot do anything except turning it off

I am not quite sure if the cpu usage will go down, if i put the line

sleep(1000);

in each branch of the if-clause. Like this :

var urls = [];

getAllDownloadLinks().forEach(function(link) {
var url = link.contentURL || link.pluginURL;
alert("Start");
if (urls.indexOf(url) == -1) {
urls.push(url);
sleep(1000);
} else {
link.enabled && link.remove();
sleep(1000);
}
alert("Ende");
})
Reply With Quote
  #6  
Old 21.02.2025, 18:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,692
Default

Quote:
Originally Posted by PicardHSV View Post
The script seems to work, but right now it let the computer hung, you cannot do anything except turning it off
Which trigger are you using? If it contains 'synchronous execution' check box in the top panel, disable it.

This will delete all dupes in one go rather than 1 by 1:
Code:
var urls = [];
var dupes = [];

getAllDownloadLinks().forEach(function(link) {
    var url = link.contentURL || link.pluginURL;

    if (urls.indexOf(url) == -1) {
        urls.push(url);
    } else {
        link.enabled && dupes.push(link.UUID);
    }
})

callAPI("downloadsV2", "removeLinks", dupes, []);
Reply With Quote
  #7  
Old 23.02.2025, 14:29
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default Jave heap space error

How can I increase the heap size for this script ?
Attached Thumbnails
Unbenannt 23.02.25.jpg  
Reply With Quote
  #8  
Old 24.02.2025, 07:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,692
Default

Which trigger are you using? Any chances multiple instances of the script are running concurrently?
Reply With Quote
  #9  
Old 24.02.2025, 09:22
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default

Quote:
Originally Posted by mgpai View Post
Which trigger are you using?
I do use trigger "Download controller started"

Quote:
Originally Posted by mgpai View Post
Any chances multiple instances of the script are running concurrently?
I restarted the computer to be sure that there are no simultaneous scripts running, but i am not quite sure if quitting JD2 it also stops the script.....
Reply With Quote
  #10  
Old 24.02.2025, 10:45
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,768
Default

Quote:
Originally Posted by PicardHSV View Post
How can I increase the heap size for this script ?
Should not be needed.
Probably JD is also on the edge of available memory without said script.

1. Post a screenshot of Help -> About JDownloader.

2. Read this:
https://support.jdownloader.org/know...loader-is-slow
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || 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?
Reply With Quote
  #11  
Old 25.02.2025, 07:30
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default Sorry to bother again

but it does not work at all.

I deleted most of the download list, put the trigger to "start Jdownloader" and restarted the programm.

After it started I got the message "End", then "Start" and nothing happened.

I checked the URLs in some of the packages and they are the same for me, but they are not deleted.
Attached Thumbnails
Unbenannt 23.02.25.jpg   Unbenannt 24.02.25.jpg  
Reply With Quote
  #12  
Old 25.02.2025, 07:42
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default okay

the script starts before the links are completey loaded , i changed the trigger to "download controller started",
started the programm and then the download, seem nothing happens....

Last edited by PicardHSV; 25.02.2025 at 07:50.
Reply With Quote
  #13  
Old 25.02.2025, 11:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,326
Default

@PicardHSV: I think I found a bug, will check it
__________________
JD-Dev & Server-Admin
Reply With Quote
  #14  
Old 25.02.2025, 14:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 82,326
Default

@PicardHSV: please try again with next core update
__________________
JD-Dev & Server-Admin
Reply With Quote
  #15  
Old 25.02.2025, 14:48
PicardHSV PicardHSV is offline
JD Addict
 
Join Date: Aug 2014
Posts: 171
Default Thanx

I will give a feedback
Reply With Quote
  #16  
Old 03.03.2025, 18:11
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 74,768
Default

CORE-Updates have been released!
All announced bugfixes and features are live!
Please update your JDownloader and report any issues you find asap.
If this thread gets marked as "[Solved]" by our forum staff you can still post in it and we will read- and reply to it!

CORE-Updates wurden released!
Alle angekündigten Bugfixes/Features sind nun verfügbar!
Bitte JDownloader updaten und eventuelle Bugs schnellstmöglich an uns melden.
Falls dieser Thread vom Team als "[Erledigt]" markiert wird, kannst du weiterhin darin antworten und wir lesen/beantworten auch solche Threads!

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || 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?
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 20:41.
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 - 2025, Jelsoft Enterprises Ltd.