JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2121  
Old 04.03.2022, 13:29
mini_ash mini_ash is offline
I will play nice!
 
Join Date: Mar 2022
Posts: 1
Default

new to this is they a way to set download folder location since it only downloads to the default folder

example looking for
youtube-url.txt = B:\\youtube-downloads
reddit-url.txt = E:\\reddit-downloads

i am using this version of the code

Quote:
Code:
/*
Add urls
Trigger : Interval
Recommended : 3600000 (1 hours) or more
*/

var file = "c:\\downloads\\urls.txt"; // valid path separators "" or "/"

try {
var links = readFile(getPath(file));

callAPI("linkgrabberv2", "addLinks", {
links: links
})

!isDownloadControllerRunning() && startDownloads();
} catch (e) {};
Reply With Quote
  #2122  
Old 04.03.2022, 16:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@mini_ash: you could move your links into a Crawljob file (use boardsearch) for the Folderwatch extension. There you can specify a download folder/package name for the links within the job.
else just specify additional "destinationFolder"
Quote:
callAPI("linkgrabberv2", "addLinks", {
links: links,
destinationFolder: "c:..."
})
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2123  
Old 04.03.2022, 16:55
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,197
Default

More information about .crawljob files (and our Folder Watch addon): Click
__________________
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
  #2124  
Old 10.03.2022, 15:56
assoemitro assoemitro is offline
Registered / Inactive
 
Join Date: Dec 2019
Posts: 15
Default

Hi, I heard this is a magical place in which we can request almost anything.

In this case, let me know if this is feasible.

I have been reviewing the speediness of the process of my computer and I found that the download speed is optimised when there is no ongoing extraction of the previous completed package.

For sample, when there is no extraction, I can have download up until 90-100Mb/s but when there is extraction, I can only have 5-8Mb/s average

1) Download in progress per package (meaning when 1 package is underway, no other package can be downloaded)

2) When the package downloaded is completed, then extraction will start (at this point no new package will start download)

3) Extraction completed and then next package will start download
Reply With Quote
  #2125  
Old 11.03.2022, 07:10
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by assoemitro View Post
... let me know if this is feasible.
Code:
/*
    Stop dwonloads during extraction
    Trigger: Package finished
*/    

var isExtracting = function() {
    return callAPI("extraction", "getQueue").length > 0;
}

if (isDownloadControllerRunning() && isExtracting()) {
    stopDownloads();

    while (isExtracting()) {
        sleep(5000);
    }

    startDownloads();
}
Reply With Quote
  #2126  
Old 11.03.2022, 11:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@mgpai: have you received my email about history idea?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2127  
Old 11.03.2022, 11:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: have you received my email about history idea?
@Jiaz: Yes I have. Thank you.

Sorry I haven't replied yet. Thought I'll check it out first and then share my thoughts. Haven't got around to it yet. Will do soon.
Reply With Quote
  #2128  
Old 11.03.2022, 12:03
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@mgpai: no need to hurry, just wanted to know if you've received an email
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2129  
Old 11.03.2022, 14:47
assoemitro assoemitro is offline
Registered / Inactive
 
Join Date: Dec 2019
Posts: 15
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Stop dwonloads during extraction
    Trigger: Package finished
*/    

var isExtracting = function() {
    return callAPI("extraction", "getQueue").length > 0;
}

if (isDownloadControllerRunning() && isExtracting()) {
    stopDownloads();

    while (isExtracting()) {
        sleep(5000);
    }

    startDownloads();
}

Thanks for your prompt action. It works but there is another point in my request that if it is possible to download 1 package at a time, so if there are 3 packages that each contains 2 files but my max simultaneous download are 5, it will only download 2 files from 1st package at this time.

The reasoning of this is that when extraction is underway, the others files will not stop downloading right away and sometimes the process takes several minutes to completely stop. Also CRC checking also become extremely slow.

++ Also I found a bug, It works for the 1st file, but the process does not repeat again for the 2nd. I think it needs additional script line to repeat the process.

Last edited by assoemitro; 11.03.2022 at 14:58. Reason: add more info + bug found
Reply With Quote
  #2130  
Old 13.03.2022, 05:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by assoemitro View Post
... but there is another point in my request that if it is possible to download 1 package at a time
To download only select packages or links you will have to to start them using 'force download start' option in context menu instead of 'start' button in the toolbar.

While this can be automated using a script, if the package does not finish downloading for any reason, the script will try to start the the same package in a loop and the list will not progress. It is better to use the default option and try to limit the active downloads using global/host connection limit.

Quote:
Originally Posted by assoemitro View Post
The reasoning of this is that when extraction is underway, the others files will not stop downloading right away and sometimes the process takes several minutes to completely stop. Also CRC checking also become extremely slow.
Try the new scripts posted below.

Quote:
Originally Posted by assoemitro View Post
++ Also I found a bug, It works for the 1st file, but the process does not repeat again for the 2nd. I think it needs additional script line to repeat the process.
I don't use JD on a regular basis, and hence can perform only short/basic tests. I could not reproduce the issue. It is quite possible my test conditions are different than yours, so cannot say for sure what it causing it.

In any case, while the following 2 scripts will not limit the downloads to a single package, it will most likely achieve your objective, since it will stop active downloads when ANY extraction activity is detected. Let me know if you run into any issues.

Code:
/*
    Stop downloads during extraction
    Trigger: Any extaction event
*/

isDownloadControllerRunning() && stopDownloads();
Code:
/*
    Start downloads after extraction
    Trigger: Archive extraction finished
*/

!callAPI("extraction", "getQueue").length && startDownloads();
Reply With Quote
  #2131  
Old 23.03.2022, 07:13
dandyclubs dandyclubs is offline
Wind Gust
 
Join Date: Apr 2013
Posts: 41
Default [request] filename wrong

#1


linkgrabber

k2s.cc site get filename

=_utf-8_B_S29yaW5hIEtvdmEgLSBUcnV0aCBvciBEYXJlIFB0MiDQkeKUgOKMoCBUaGUgY2FyIHJpZGUgaG9tZS5tcDQ=_=

=_utf-8_B_ start

i know this need
base64 to utf-8


i try

Code:
var linkName
if (link.getName() !== null) {
    //var extension = (linkName.match(/\.([^.]*?)(?=\?|#|$)/) || [])[1];    
    linkName = link.getName().replace(/(\s)?\/(\s)?/g, '/');
    link.setName(linkName)

    if (linkName.match("%")) {
        link.setName(decURI(linkName))
    }

    if (linkName.match(/=_utf-8_B_(.+)/)) {
        linkName = linkName.match(/=_utf-8_B_(.+)/).pop().replace('=_=', '')
        linkName = b64_to_utf8(linkName)
        link.setName(linkName)
    }
}
//link.setName(linkName + "." + extension);



function UnescapeUTF8(str) {
    return str.replace(/%(E(0%[AB]|[1-CEF]%[89AB]|D%[89])[0-9A-F]|C[2-9A-F]|D[0-9A-F])%[89AB][0-9A-F]|%[0-7][0-9A-F]/ig, function(s) {
        var c = parseInt(s.substring(1), 16);
        return String.fromCharCode(c < 128 ? c : c < 224 ? (c & 31) << 6 | parseInt(s.substring(4), 16) & 63 : ((c & 15) << 6 | parseInt(s.substring(4), 16) & 63) << 6 | parseInt(s.substring(7), 16) & 63)
    })
};

function decURI(str) {

    var charCode = "";
    if (str.match("%")) {
        try {
            charCode = GetEscapeCodeType(str);
            console.log(charCode)
            if (charCode == "UTF8") {
                str = UnescapeUTF8(str);
            } else if (charCode == "EUCJP") {
                //str = UnescapeEUCJP(str);
            } else if (charCode == "SJIS") {
                //str = UnescapeSJIS(str);
            } else if (charCode == "Unicode") {
                //str = unescape(str);
            }

            return str;

        } catch (e) {
            //throw(e);            
        }
    } else {
        return str;
    }

    //throw new Error();
}

function b64_to_utf8(str) {
    return decodeURIComponent(escape(window.atob(str)));
}

function GetEscapeCodeType(str) {
    if (/%u[0-9A-F]{4}/i.test(str)) return "Unicode";
    if (/%([0-9A-DF][0-9A-F]%[8A]0%|E0%80|[0-7][0-9A-F]|C[01])%[8A]0|%00|%[7F]F/i.test(str)) return "UTF16LE";
    if (/%E[0-9A-F]%[8A]0%[8A]0|%[CD][0-9A-F]%[8A]0/i.test(str)) return "UTF8";
    if (/%F[DE]/i.test(str)) return /%8[0-9A-D]|%9[0-9A-F]|%A0/i.test(str) ? "UTF16LE" : "EUCJP";
    if (/%1B/i.test(str)) return /%[A-D][0-9A-F]/i.test(str) ? "JIS8" : "JIS7";
    var S = str.substring(0, 6143).replace(/%[0-9A-F]{2}|[^ ]| /ig, function(s) {
            return s.length < 3 ? "40" : s.substring(1)
        }),
        c, C, i = 0,
        T;
    while (0 <= (c = parseInt(S.substring(i, i += 2), 16)) && i < 4092)
        if (128 <= c) {
            if ((C = parseInt(S.substring(i, i + 2), 16)) < 128) i += 2;
            else if (194 <= c && c < 240 && C < 192) {
                if (c < 224) {
                    T = "UTF8";
                    i += 2;
                    continue
                }
                if (2 == parseInt(S.charAt(i + 2), 16) >> 2) {
                    T = "UTF8";
                    i += 4;
                    continue
                }
            }
            if (142 == c && 161 <= C && C < 224) {
                if (!T) T = "EUCJP";
                if ("EUCJP" == T) continue
            }
            if (c < 161) return "SJIS";
            if (c < 224 && !T)
                if ((164 == c && C < 244 || 165 == c && C < 247) && 161 <= C) i += 2;
                else T = 224 <= C ? "EUCJP" : "SJIS";
            else T = "EUCJP"
        }
    return T ? T : "EUCJP"
};
trigger : a new link has been added

is correct??


#2

some file start download change encoding filename

linkgrabber filename 사랑합니다.rar

download start change %EC%82%AC%EB%9E%91%ED%95%A9%EB%8B%88%EB%8B%A4.rar



#3

some archive extra filename is %EC%82%AC%EB%9E%91%ED%95%A9%EB%8B%88%EB%8B%A4

(korean japanese chinese)

how to decoding?

Last edited by dandyclubs; 23.03.2022 at 08:30.
Reply With Quote
  #2132  
Old 23.03.2022, 11:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@dandyclubs: can you please provide example links to support@jdownloader.org
this can easily be fixed in the plugins themselves. No need for custom workaround
#1 can easily be fixed in the plugin and #2 and #3 is a sign that the hoster does not correct signal encoding and plugin does not apply auto correct/guess
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2133  
Old 23.03.2022, 14:52
dandyclubs dandyclubs is offline
Wind Gust
 
Join Date: Apr 2013
Posts: 41
Default #3 sevenzipjbinding extration

sevenzipjbinding

some zip file extration finished

filename wrong encoding

mac => korean window system...

so use

bandizip Code-page change

Last edited by dandyclubs; 23.03.2022 at 14:59.
Reply With Quote
  #2134  
Old 23.03.2022, 17:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@dandyclubs: I've replied to filename, yes, zip and unicode can cause issues because of local code page and zip may not be properly utf-8 filenames
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2135  
Old 23.03.2022, 17:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

Quote:
Originally Posted by dandyclubs View Post
bandizip Code-page change
Tool that fixed names in zips?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2136  
Old 25.03.2022, 12:38
thehulk14 thehulk14 is offline
Registered / Inactive
 
Join Date: May 2019
Posts: 13
Exclamation Add an script/option to bind IP address per selected downloads in the list

Hello everyone,

Is it possible to create script to add an option/button in context menu to bind IP address per selected downloads?

When using 2 networks, I want to set some selected folders in the "Downloads tab" to specific IP address ( ex. 190.186.1.1 )
So these selected folders will always use the specified IP address above ( without being limited to the host/site name )

This script/option for me is essential, for easy changing/binding between IP address, but nfortuantly I don't know how to do it :(

Any help will be appreciated
Reply With Quote
  #2137  
Old 25.03.2022, 12:54
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@thehulk14:
that is currently not possible/supported.
are the downloads from different hosts? if yes, then you can already achieve this via black/white-listing in Settings->Connections.
Only if the downloads are from same host, it's not possible yet.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2138  
Old 25.03.2022, 21:10
thehulk14 thehulk14 is offline
Registered / Inactive
 
Join Date: May 2019
Posts: 13
Default

Quote:
Originally Posted by Jiaz View Post
@thehulk14:
that is currently not possible/supported.
are the downloads from different hosts? if yes, then you can already achieve this via black/white-listing in Settings->Connections.
Only if the downloads are from same host, it's not possible yet.
Thanks for your reply.
Unfortunately it's the same host, I hope it will be supported in the upcoming updates.
Reply With Quote
  #2139  
Old 28.03.2022, 12:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@thehulk14: when it's from same host, does it matter to be a specific IP or do you want to use 2 IPs in order to download two files at the same time? it's already possible to spread downloads from same host over multiple different connections
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2140  
Old 09.04.2022, 06:21
thehulk14 thehulk14 is offline
Registered / Inactive
 
Join Date: May 2019
Posts: 13
Default

Quote:
Originally Posted by Jiaz View Post
@thehulk14: when it's from same host, does it matter to be a specific IP or do you want to use 2 IPs in order to download two files at the same time? it's already possible to spread downloads from same host over multiple different connections
Sorry for very late reply, I wasn't around and just found your reply.
It actually does matter, since when using 2 IPs with 2 simultaneous connections ( example 1st IP 190.186.1.1, 2nd 190.186.1.2 )
and one of the file is finished (190.186.1.1), the next download will use the 2nd IP (190.186.1.2) instead of (190.186.1.1)
Which will waste the downloading time..

Edit: updated the example IPs.

Last edited by thehulk14; 09.04.2022 at 06:24. Reason: updated the example IPs.
Reply With Quote
  #2141  
Old 11.04.2022, 10:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@thehulk14: What host is it? does the host allow multiple downloads per IP or just one?
I don't see any problem with existing settings to balance downloads over connections, the first download should use proxy A and the next one should use proxy B.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2142  
Old 12.04.2022, 07:06
bolex17 bolex17 is offline
Modem User
 
Join Date: Jan 2022
Posts: 2
Default

Hi team!
Really loving JDownloader and finally have all my scripts set up properly.

Just wondering whether this one would be possible?

I have a folder link which is updated every week with new episodes, is there a script to automatically refresh the link and automatically add the new file at all?

Thanks!
Reply With Quote
  #2143  
Old 12.04.2022, 11:14
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@mgpai: I need your master brain for help I need a simple script. Links are in linkgrabber and the script should just iterate through the list and remove duplicates (same download url). I thought something like iterate through list and add each url to a map/set and in case it's already there, then we can remove the entry from list and continue with next one.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2144  
Old 12.04.2022, 11:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by bolex17 View Post
... is there a script to automatically refresh the link and automatically add the new file at all?
Check post #2106
Reply With Quote
  #2145  
Old 12.04.2022, 11:40
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: ... script should just iterate through the list and remove duplicates (same download url).
@Jiaz: Hi

Will this do?
Code:
/* 
    Remove duplicate links
    Trigger : Toolbar button pressed
*/

if (name == "Remove duplicate links") {
    var urls = [];

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

        if (urls.indexOf(url) == -1) {
            urls.push(url);
        } else {
            link.remove();
        }
    })
}
Reply With Quote
  #2146  
Old 12.04.2022, 11:45
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@mgpai: you dream in script language, don't you nice&easy, thank you so much
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2147  
Old 12.04.2022, 11:50
thehulk14 thehulk14 is offline
Registered / Inactive
 
Join Date: May 2019
Posts: 13
Default

Quote:
Originally Posted by Jiaz View Post
@thehulk14: What host is it? does the host allow multiple downloads per IP or just one?
I don't see any problem with existing settings to balance downloads over connections, the first download should use proxy A and the next one should use proxy B.
Hmm, ok will try it again and see.
Reply With Quote
  #2148  
Old 12.04.2022, 13:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: you dream in script language, don't you
haha.

Quote:
Originally Posted by Jiaz View Post
nice&easy, thank you so much
My pleasure.
Reply With Quote
  #2149  
Old 13.04.2022, 03:14
bolex17 bolex17 is offline
Modem User
 
Join Date: Jan 2022
Posts: 2
Default

Quote:
Originally Posted by mgpai View Post
Check post **External links are only visible to Support Staff**...
Thank you so much for this! I've got the link to auto add and update - something I've been wanting for awhile.

I'm not very familiar with the Packagizer function and having some trouble working out how to add 'new' links only and having them automatically download.

Any further guidance on what variables I should be using? Thanks in advance!

Here is my settings but I'm pretty sure it's wrong.



Thanks again!
Reply With Quote
  #2150  
Old 13.04.2022, 07:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by bolex17 View Post
...what variables I should be using?
Auto Confirm : Enabled (Sends links to the download list)
Enable Download : Link are enabled by default, so should not be required.
Reply With Quote
  #2151  
Old 13.04.2022, 11:18
qowmq qowmq is offline
Registered / Inactive
 
Join Date: Apr 2022
Posts: 2
Default event scripter getPage language broken

When the download is complete, you will receive a message via Telegram.
It can be used normally, but Korean and Japanese other than English are broken as "???".
Doesn't getPage of getBrowser() support other languages?

Here is the code I'm using.
Code:
/*
	Event Script: Telegram notification when download completes 
 	Requirements:
	Trigger "Package Finished"
*/

var browser = getBrowser();
var apiToken = 'apiToken'; 
var chatId = 'chatId';
var url = "**External links are only visible to Support Staff**;

if (package.isFinished()) {
	var reName = package.name.replace(/^_/g, ""); // korean package _ delete
	var linkList = package.getDownloadLinks();		

	var msg = "JDownloader" + "%0A" //enter
			+ reName
			+ " Download Finished"
			
	url += apiToken + "/sendMessage?chat_id=" + chatId + "&parse_mode=html&text=" + msg;
	
	browser.getPage(url); //telegram send
	
	getPath(package.getDownloadFolder()).delete(); //temp path delete
	package.remove(); //link delete
}
Reply With Quote
  #2152  
Old 13.04.2022, 13:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@qowmq: message must be correctly urlencoded, I will check how to do this

Update: you can use encodeURIComponent("string"), eg
Quote:
var reName = package.n......
reName=encodeURIComponent(encodeURIComponent);
var linkLis.....
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 13.04.2022 at 16:33.
Reply With Quote
  #2153  
Old 13.04.2022, 23:39
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 73,197
Default

@qowmq
Nice and simple
__________________
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
  #2154  
Old 14.04.2022, 04:16
qowmq qowmq is offline
Registered / Inactive
 
Join Date: Apr 2022
Posts: 2
Default

Quote:
Originally Posted by Jiaz View Post
@qowmq: message must be correctly urlencoded, I will check how to do this

Update: you can use encodeURIComponent("string"), eg
thank you. Solved.
Reply With Quote
  #2155  
Old 14.04.2022, 10:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@qowmq: Thanks for the feedback and you're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2156  
Old 16.04.2022, 08:15
runjayemcee runjayemcee is offline
Registered / Inactive
 
Join Date: Apr 2022
Posts: 1
Default

Can I get some help for a script for a headless setup for Pushover notification? I would like to send a pushover notification on file download complete.

I found this script but not sure how to convert it to work for a headless script
Code:
postPage("https" + "://api.pushover.net/1/messages.json",
"token=appToken&user=userKey&message="
+ package.getName() +
" finished.");

Last edited by runjayemcee; 16.04.2022 at 08:19.
Reply With Quote
  #2157  
Old 16.04.2022, 11:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,051
Default

@runjayemcee: most easiest way is to use JDownloader with GUI and setup your eventscripter scripts and then copy/paste them via Settings->Advanced Settings->EventScripter.scripts
see https://support.jdownloader.org/Know...event-scripter "Headless / myjdownloader"
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2158  
Old 29.04.2022, 11:02
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 700
Default

A way / script would be great that could find / show / list duplicates (by content) in the downloadslist not having the same URL and / or name. Or at least files that might be duplicates by its size, if the bit size exactly is the same.

https://board.jdownloader.org/showth...473#post501473
__________________
Aktuelles Windows

Last edited by Dockel; 29.04.2022 at 11:07.
Reply With Quote
  #2159  
Old 29.04.2022, 14:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,601
Default

Quote:
Originally Posted by Dockel View Post
.. find / show / list duplicates (by content) in the downloadslist ... by its size, if the bit size exactly is the same.
List will be exported in html format (saved as "dupes_by_size.htm" in JD\tmp folder)

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);
    }
}
Reply With Quote
  #2160  
Old 29.04.2022, 15:28
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 700
Default

Thank you very much! Very fast!

I have added it to the Event Scripter now:


And now I have to add a button / menu item somehow e.g. in the Menu Customizer here:


Sorry, I have forgotten how to do it. What do I have to do?
__________________
Aktuelles Windows
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 14: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 - 2024, Jelsoft Enterprises Ltd.