JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2141  
Old 11.04.2022, 09:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
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, 06: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, 10:14
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
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, 10:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
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, 10:40
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
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, 10:45
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
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, 10:50
thehulk14 thehulk14 is offline
Junior Loader
 
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, 12:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
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, 02: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, 06:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
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, 10:18
qowmq qowmq is offline
Modem User
 
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, 12:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
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 15:33.
Reply With Quote
  #2153  
Old 13.04.2022, 22:39
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 68,419
Default

@qowmq
Nice and simple
__________________

On vacation / im Urlaub
START: 2023-09-26
END: TBA


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
  #2154  
Old 14.04.2022, 03:16
qowmq qowmq is offline
Modem User
 
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, 09:52
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@qowmq: Thanks for the feedback and you're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2156  
Old 16.04.2022, 07:15
runjayemcee runjayemcee is offline
Modem User
 
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 07:19.
Reply With Quote
  #2157  
Old 16.04.2022, 10:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
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, 10:02
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 616
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 10:07.
Reply With Quote
  #2159  
Old 29.04.2022, 13:31
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
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, 14:28
Dockel Dockel is offline
JD Legend
 
Join Date: Feb 2020
Posts: 616
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 11:24.
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.