JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1941  
Old 18.10.2021, 13:12
schnacke schnacke is offline
Modem User
 
Join Date: Oct 2021
Posts: 3
Default

Hey Jiaz,

this helps a lot
Quote:
Originally Posted by Jiaz View Post
superuser.com/questions/782509/unable-to-ssh-cannot-create-dev-null-ssh
I changed the home directory in /etc/passwd and now it's working.

Thanks!
Reply With Quote
  #1942  
Old 18.10.2021, 13:23
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

Quote:
Originally Posted by schnacke View Post
Hey Jiaz,
this helps a lot
I changed the home directory in /etc/passwd and now it's working.
Thanks!
Thanks for the feedback!
Let me guess, it was /dev/null ?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1943  
Old 18.10.2021, 14:09
schnacke schnacke is offline
Modem User
 
Join Date: Oct 2021
Posts: 3
Default

Yes you're right
Reply With Quote
  #1944  
Old 20.10.2021, 23:03
Bilkoff Bilkoff is offline
Junior Loader
 
Join Date: Sep 2019
Posts: 10
Default

Is it possible to count the number of files in a local folder?

EDIT: Like 3h searching and after 5 minutes of posting I found it:
Code:
var folder = getPath("C:\\folder\\");
alert(folder.getChildren().length);

Last edited by Bilkoff; 20.10.2021 at 23:18.
Reply With Quote
  #1945  
Old 21.10.2021, 09:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

@Bilkoff: The array returned by that method can include both files and folders. isFile() and isDirectory() methods can be used to check the type of object in that array.
Reply With Quote
  #1946  
Old 21.10.2021, 20:04
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by TomNguyen View Post
As I went through all pages the other day, I have made a list of event scripts created by @mgpai. It seems can be a temp index. Hope this helps.
Thanks @TomNguyen for all the hardwork. We appreciate it!
Reply With Quote
  #1947  
Old 21.10.2021, 20:07
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Hi @mgpai, can you help me with script to download files at random with all the other conditions in tact i.e. total number of downloads, no of downloads per host etc... please?
Reply With Quote
  #1948  
Old 22.10.2021, 05:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,528
Default

Quote:
Originally Posted by reddy.shyam View Post
... download files at random
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];
    }
})
Reply With Quote
  #1949  
Old 22.10.2021, 10:49
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
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];
    }
})
Wow! Thanks @mgpai! That was quick! Really appreciate it!

From what I understand of the code, this will just effect what the container holds when the download controller is started and does not include the new links added after the trigger is started. Isn't it?

Edit: I have also added the same script to Trigger "LinkGrabber Bottom Button Pressed". Will this do?

Last edited by reddy.shyam; 22.10.2021 at 12:02.
Reply With Quote
  #1950  
Old 22.10.2021, 12:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@mgpai: nice solution my first thought was to randomize the order of the links within the packages
@reddy.shyam: you could even use "download started" as trigger the script does not rely on any special trigger objects
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1951  
Old 22.10.2021, 12:38
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: nice solution my first thought was to randomize the order of the links within the packages
@reddy.shyam: you could even use "download started" as trigger the script does not rely on any special trigger objects
Hi @Jiaz, thanks for replying. I too assumed it would be some kind of sorting. Looks like @mgpai is altogether at a different level.

Regarding your solution, If "download started" trigger means every time a new download starts, then don't you think "LinkGrabber Bottom Bar Button Pressed" is better? With "Download started" the list gets re-sorted everytime a new download begins irrespective of new links added or not but with "LinkGrabber Bottom Bar Button Pressed" trigger, re-sorting is done only when new links are added.

Is my understanding wrong?
Reply With Quote
  #1952  
Old 22.10.2021, 12:51
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@reddy.shyam: the list is not sorted but the links priorites are getting changed and thus the download core redo the *what to download next* calculations with each new download.
"LinkGrabber Bottom Bar Button Pressed" -> you will have to add a script/action to the button bar for this to work. It's not about new links added. You can customize the buttom bar with custom actions and then assign scripts to them.
You could also use "Download stopped" to only re-prioritize them when a download stopps
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1953  
Old 22.10.2021, 13:16
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by Jiaz View Post
@reddy.shyam: the list is not sorted but the links priorites are getting changed and thus the download core redo the *what to download next* calculations with each new download.
"LinkGrabber Bottom Bar Button Pressed" -> you will have to add a script/action to the button bar for this to work. It's not about new links added. You can customize the buttom bar with custom actions and then assign scripts to them.
You could also use "Download stopped" to only re-prioritize them when a download stopps
Thanks @Jiaz, I see what you mean. In that case, "Download starts"/"Download stops" seems better idea than "Download controller started". I feel "Download starts" better option because if we use "Download stops" there might be performance impact of setting the priority before another download begins. Isn't it?
Reply With Quote
  #1954  
Old 22.10.2021, 13:25
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,044
Default

@mgpai
lol creative solution
__________________
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
  #1955  
Old 22.10.2021, 13:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

Quote:
Originally Posted by reddy.shyam View Post
there might be performance impact of setting the priority before another download begins. Isn't it?
doesn't matter if before or after, it's the same
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1956  
Old 22.10.2021, 14:07
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by Jiaz View Post
doesn't matter if before or after, it's the same
Thanks @Jiaz. Will do a 'inky pinky ponky' and pick up.
Reply With Quote
  #1957  
Old 25.10.2021, 13:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,232
Default

@reddy.shyam: You're welcome. Whenever you need help, just ask
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1958  
Old 28.10.2021, 01:00
tb21 tb21 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 14
Question How to read Archive Extractor setting?

Hi folks! o)

A quick question, how do I get the following boolean setting by script?
"Archive Extractor -> Extract archives after download"
(Attached image also shows what setting I am looking for.)

I can't find the key for the setting anywhere on github or config files of JD.

I was able to find correct api, storage and key strings for other settings like:
"Archive Extractor -> Enabled"
"Archive Extractor -> Extract to following folder"
"Archive Extractor -> Extract to.."

Any help appreciated! Thank you! o)
Attached Images
File Type: png jdown_settings.png (54.6 KB, 1 views)
Reply With Quote
  #1959  
Old 28.10.2021, 01:05
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 8
Default

Hi mgpai,

I was referred over by Jiaz from another thread, do you have a script available that can enable or disable "Silent Mode" (or Settings->Advanced Settings->SoundSettings.captchasoundenabled) on a time basis.

Basically I want to stop the captchas from waking up the entire household while everyone's asleep.
Reply With Quote
  #1960  
Old 28.10.2021, 01:35
tb21 tb21 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 14
Default

It can be done by an "Interval" event script (once a minute e.g.).

I would suggest lowering the volume of the whole system though, as other applications could make weird sounds as well, it may be easier for you as well, if you can't write scripts (yet).

There is a tool called "nircmd.exe" out there, create a scheduled task and run it at bed time start to bring the volume down.
>nircmd.exe setvolume 0 0 0
Create another scheduled task to bring volume back to normal.
>nircmd.exe setvolume 0 65535 65535

Nircmds setvolume reference here: nircmd.nirsoft.net/setvolume.html
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 04:46.
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.