JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1961  
Old 28.10.2021, 01:00
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 6
Default

Quote:
Originally Posted by tb21 View Post
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
I'm already able to achieve this with windows "Focus Assist" on a schedule. It's just that JD overrides this somehow. I think I need more of an internal solution...

Last edited by dawebbreb; 28.10.2021 at 01:02.
Reply With Quote
  #1962  
Old 28.10.2021, 01:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,342
Default

Quote:
Originally Posted by tb21 View Post
... get the following boolean setting by script?
"Archive Extractor -> Extract archives after download"
I cannot access the attachments, but going by your description I am guessing you mean this:

Code:
[{
    "abstractType": "BOOLEAN",
    "interfaceName": "org.jdownloader.gui.views.linkgrabber.addlinksdialog.LinkgrabberSettings",
    "type": "boolean",
    "key": "AutoExtractionEnabled"
}]
Reply With Quote
  #1963  
Old 28.10.2021, 02:08
tb21 tb21 is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

@dawebbreb
Try this..

Code:
//disable captcha sound at night
//Trigger "Interval"

var date = new Date();
var hours = date.getHours();

if (0);
else if (hours > 21) setCaptchaSoundEnabled( false);
else if (hours > 7) setCaptchaSoundEnabled( true);

function isCaptchaSoundEnabled() {
    var key = "captchasoundenabled";
    var interfaceName = "org.jdownloader.settings.SoundSettings";
    var value = callAPI("config", "get", interfaceName, null, key); //bool
    return value;
}
function setCaptchaSoundEnabled( truefalse) {
    var key = "captchasoundenabled";
    var interfaceName = "org.jdownloader.settings.SoundSettings";
    var value = callAPI("config", "set", interfaceName, null, key, truefalse); //bool
    return value;
}
Reply With Quote
  #1964  
Old 28.10.2021, 02:15
tb21 tb21 is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

@mgpai
I tried, you nailed it, thank you very much! o)
I never expected this setting to be somewhere in the linkgrabber stuff.
Reply With Quote
  #1965  
Old 28.10.2021, 02:56
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 6
Default

Quote:
Originally Posted by tb21 View Post
@dawebbreb
Try this..

Code:
//disable captcha sound at night
//Trigger "Interval"

var date = new Date();
var hours = date.getHours();

if (0);
else if (hours > 21) setCaptchaSoundEnabled( false);
else if (hours > 7) setCaptchaSoundEnabled( true);

function isCaptchaSoundEnabled() {
    var key = "captchasoundenabled";
    var interfaceName = "org.jdownloader.settings.SoundSettings";
    var value = callAPI("config", "get", interfaceName, null, key); //bool
    return value;
}
function setCaptchaSoundEnabled( truefalse) {
    var key = "captchasoundenabled";
    var interfaceName = "org.jdownloader.settings.SoundSettings";
    var value = callAPI("config", "set", interfaceName, null, key, truefalse); //bool
    return value;
}
Ok perfect, so I set the interval to 15 mins (900000ms) and I tweaked your code to 23 and 9. To my understanding this should fire anytime within 15mins of 11PM and turn back on withing 15mins of 9am correct?

I will report back!
Reply With Quote
  #1966  
Old 28.10.2021, 03:38
tb21 tb21 is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

Yes, correct. o) Maybe enhance the time testing conditions a bit, to also make the script switch the captcha sound OFF between 0 and 8 o'clock actively, not just between 22 and midnight. Like so..
Code:
else if (hours > 21 || hours <= 7) setCaptchaSoundEnabled( false);
else if (hours > 7) setCaptchaSoundEnabled( true);
Reply With Quote
  #1967  
Old 28.10.2021, 04:11
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 6
Default

Quote:
Originally Posted by tb21 View Post
Yes, correct. o) Maybe enhance the time testing conditions a bit, to also make the script switch the captcha sound OFF between 0 and 8 o'clock actively, not just between 22 and midnight. Like so..
Code:
else if (hours > 21 || hours <= 7) setCaptchaSoundEnabled( false);
else if (hours > 7) setCaptchaSoundEnabled( true);
Even better! Thanks for setting me on the right path!!
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 06:19.
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 - 2021, Jelsoft Enterprises Ltd.