JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1961  
Old 28.10.2021, 02:00
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 8
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 02:02.
Reply With Quote
  #1962  
Old 28.10.2021, 02:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
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, 03:08
tb21 tb21 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 14
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, 03:15
tb21 tb21 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 14
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, 03:56
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 8
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, 04:38
tb21 tb21 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 14
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, 05:11
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 8
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
  #1968  
Old 28.10.2021, 10:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@mgpai and @tb21: great to see two masters working hand in hand
@tb21: whenever you need help or got questions, you can also contact us via support@jdownloader.org
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1969  
Old 29.10.2021, 01:37
dawebbreb dawebbreb is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 8
Default

Thank you @tb21 and @Jiaz. Happy to report script worked just as expected and I was able to sleep fine last night!!
Reply With Quote
  #1970  
Old 01.11.2021, 00:02
JDL1059 JDL1059 is offline
Junior Loader
 
Join Date: Oct 2021
Posts: 10
Default

Quote:
Originally Posted by JDL1059 View Post
So I have a list of megaupload links where I would like a script to basically check on those list of links periodically, and if new files are added to the link that it hasn't already downloaded, it will start downloading that.

Is that possible?
Quote:
Originally Posted by Jiaz View Post
@JDL1059: list of links? where does the new link come from then? is it normal text/website with links on it or how do you expect JDownloader to check for new links? more details are required in order to help/answer you
Quote:
Originally Posted by JDL1059 View Post
Hi Jiaz - it would be a list of links i manually input (it could be added to a textfile, or pasted into the jdownloader app itself). I'm not sure exactly the best method, but essentially say i have a list of 10 links that i would like jdownloader to check maybe once a day / week if new files have been added. Over time i would add more links to that said text file.
@mgpai hello I was wondering if you may have some thoughts around this process I'm trying to accomplish. I would think maybe using a text file and pasting the core megaupload links there would be best, then jdownloader can run a script to check that text file occasionally and import any new downloads.
Reply With Quote
  #1971  
Old 02.11.2021, 01:29
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Post Script request: YouTube video filenames

I have a script request or an idea request for another way.

For the YouTube plugin filename setting for videos, I have the default setting:

*3D* *360* *VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*).*EXT*

Over time this file naming has become non-unique enough for one location that it causes "filename already exist" issues. To compound this issue, YouTube videos seem to vary slightly in file size depending on when you download it. It seems to range around 20 megs or so; so it's not always the exact size even though it's the same video.

Moving forward, I want to have the filename for all new videos to include the channel name, like:

*3D* *360* *VIDEO_NAME* *CHANNEL* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*).*EXT*

However because of files already existing, I'm looking for a way to avoid duplicate files but still have new downloads with the new naming that includes the channel name.

I was thinking a script that checks with the old naming first, and if it exists, it checks to make sure the file size is within a certain range (something like 20 megs or so) for a best guess that it is the same video and then skip the download. If it's not within the file size range, the best guess is it's a new video and it should name the file with the new naming that includes the channel name. Not sure if this is possible. Any ideas?
Reply With Quote
  #1972  
Old 02.11.2021, 04:24
Marvel Marvel is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

Hi Guys Need Help for (Four Script)

Okay I tried in English,

I have read in in event Scripter, and found some "Simila" things here, but not works what I tried to configure,

I have litte understood how it event scripts in downloader works, but I doo not understood scripting.

And I hope you can help me. If you from Germany you can write and explain me in German if not, then English Thanks.

1) Okay that what I need, I need a Notification Trigger if Download speed drops Longer than 1 min under 50 kbit.
And play some WAV better a mp3 file.

I have tried to make my own wav file and convert sound from Mac OS built in sound, but it not works with the build in Examples, if download stops or extract scripts, it only works with the original wav File captcha sound. I don’t know why ?

The example scripts in JD2 work well. And the sound also. (The Example scripts)

Okay Second

2) some Downloads that never Stops and not running by 0/kbs hang up. Some times the VPN connection hang up. And the downloads not stopping and running over by 0/kbs. the build in notifications examples is not working there. To make Notification Sound Trigger.

(some from „Mega“ downloads stops and not running anymore, without stopping in jdownloader)

Third

3) I need a Script, if Download Speed Drops Longer than 2 min under 500 kbit,

- play some Sound and Notification trigger- stop and Disable File - Spring to Next Download (package) and start download

4) Unziping File with Downloader,

If I Unzip File In JD,

example more than 50 Files I take time,(25-30 min to unzip all), is it Possible to make Notification Sound trigger if Only All Packages Unzip, (with a Unique Sound Hope mp3 Sound is Possible) 50 Files is just a example guys.

(I Only Found the example in JD2 Trigger that make Wav sound, File By File)


(Best if Possible a mp3 Sound) please explain witch Programm I need to convert a Sound in wav if mp3 not working. I have use mediaHuman Audio converter to convert it in wav, but not working.

I got stuck and Google and Youtube couldn't find any further templates and instructions. Can someone help me and write a script that I can then copy into Jdownloader? Thanks in advance for the effort

Greatings Marvel
Reply With Quote
  #1973  
Old 02.11.2021, 10:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@mrjjones: You could also add the video ID to the filename and then use script to filter out already existing links. rename should be possible but sounds little more complex though
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1974  
Old 02.11.2021, 10:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Marvel:
1.) Whats the idea behind sound notification on low speed? what do you want to achieve then?
2.) do you use VPN or proxy? sounds like the read is blocking within OS and thus blocked. Does this happen on all downloads or just some? Can you please create a log, see https://support.jdownloader.org/Know...d-session-logs
when this happens and then post logID here
4.) you want notification if extraction is finished? not clear for me
(PS: du kannst auch gerne nochmal in Deutsch erklären )
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1975  
Old 02.11.2021, 14:27
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Post

Quote:
Originally Posted by Jiaz View Post
@mrjjones: You could also add the video ID to the filename and then use script to filter out already existing links. rename should be possible but sounds little more complex though
@Jiaz:

Great point about the video ID as many of the duplicates come from the same channel. I added that to my new filename mission. Thanks. A rename shouldn't be necessary the more I think about it.

Below is my logic as a non-programmer. Major things I don't know and if are even possible is setting the filename with the YouTube plugin variables in the script. Also not sure how to calculate if current file size within 10MB of new file size. I'd appreciate any help from anyone.

NOT ACTUAL CODE
Code:
**NOT ACTUAL CODE** I don't know what I'm doing, just trying to make sense:

newFileName: *CHANNEL*_*VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*)_*VIDEOID*.*EXT*
oldFileName: *3D* *360* *VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*).*EXT*

if newFileName already exists
    skip
    end
    
if newFileName OR oldFileName does not exist
    add link with newFileName
    end

if oldFileName already exists
    if current file size within 10MB of new file size
        skip
        end
    if current file size not within 10MB of new file size
        add link with newFileName
        end
Reply With Quote
  #1976  
Old 02.11.2021, 19:06
Gbyte Gbyte is offline
I will play nice!
 
Join Date: Nov 2021
Posts: 4
Question Extraction Path Variable

Good evening,

does anybody know what the variable name is that contains the Extraction Path for the Event Scripter? I know that it existed and i had it befor but after the complete los of my config i cant find it anymore.

With best regards,
me
Reply With Quote
  #1977  
Old 02.11.2021, 19:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Gbyte: can you please be more specific? extraction path of? generic path? of a specific archive?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1978  
Old 02.11.2021, 20:03
Marvel Marvel is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

@Jiaz

Gott Sein Dank in Deutsch, ist schön "Tricki" das auf English zu erklären

Also ich Brauch einen Notification Trigger wenn Der Monitor aus ist und Jdownloader Weiter im Hintergrund läuft., und ne Meldung ausgibt aus den eingebauten Lautsprechern


1 ) manchmal Reduziert der Hoster wieso auch immer die Geschwindigkeit bei einem File ( nicht bei allen), wenn ich dann, später wieder am Rechner bin hoff ich natürlich das Files fertig sind, leider passiert es dann das JD an dem File hängen geblieben ist und es nur 50kbit runterlädt. Das File kann ich auch bei einem Anderen Hoster schneller Runterladen, das merk ich natürlich erst wenn ich wieder am Rechner sitze und den Monitor anmache. Und Manuell stope und ein anderes File zum download starte.

Der Notification Trigger ist nur ein Hinweis Geber das ich wenn ich zeit habe nochmal einschalte und ein anderes Paket Manuell wähle.


2) Das Passiert nur bei nur Bei Mega Files ,

aber nutze ne VPN App, die Beendet die Verbindung nicht sonder Springt von Grün (VPN) auf Orange, und das nicht bei jeder Verbindung nur bei einigen Ländern, Doof nur wenn das Passiert und wenn man dann wieder zurück kommt an den Rechner. (ROT würde VPN Beendet und JD würde ja stoppen.)

Ich hab ihr zwar ein ähnliches Problem gefunden von einem hab das aber soo für mich nicht übernehmen können als script. Im Event-script Bereich

Mir würde das aber auch schon gut reichen wenn der DOWNLOAD DANN EINFACH STOPPEN WÜRDE, und nicht bei 0Kbs hänglen bliebe.

Notification-Sound in JD gibt ne Meldung aus, So kann ich Die VPN App Verbindung Manuell Disconnecten und ne Neue Verbindung aufbauen.

Ich hab ihr zwar ein ähnliches Problem gefunden von einem hab das aber soo für mich nicht übernehmen können als script. Im Event-script Bereich

4) Ja, bitte, und zwar hab ich das eingebaute Example genutzt was gut funktioniert, File by File,aber manchmal dauert es seine Zeit, solche Pakete zu entpacken, den ich mache was anderes In der Zeit, und hab dann den Monitor aus. Denn ich entpacke die Pakete immer dann wenn ich den Rechner nicht brauche, gleichzeitig und während dem Surfen ist der Arbeitsspeicher bereits bedient. Und soo gut wie unbenutzbar.

Download und entpacken Gleichzeitig, hab ich festgestellt reduzieren die Geschwindigkeit des Downloads und Leider auch ist JD, dann auch, Crash anfälliger.

Und Die eingebauten Lautsprecher Triggern mir dann und sagen bescheid wenns fertig ist.

Man kann auch TV Sehen und weiss "Beep "fertig alles im Hintergrund. Und Monitor ist aus. Dann weiss man wann man wieder an den Rechner muss.

Also ich benutze Amphetamine ein Notification Trigger App, wenn JDownloader läuft und Der Monitor aus ist und ab und An Passiert es, das während der Download läuft, JD im Crasht.
Wenn er das dann aber triggert kann ich gleich JD Neustarten.

Dann hör ich ein mp3 Lied was ich voreingestellt habe.

Früher hab ich erst nach 40 min gar na nachstunden erstgemerkt, natürlich erst wenn ich wieder am Rechner war das JD gecrasht ist und eigentlich kein Download lief, was zum Kotzen war.

Also im Grossen ganzen geht es beim Notification Triggern nur darum das ich weiss wenns ein Problem gibt und ich dann Manuell die Sachen Fixxe. und kein Monitor laufen lassen muss.

Ich hab schon einiges ausprobiert an Notification Apps die alle nicht gut liefen, wenn der JD sich selbst melden würde und selbst wechseln wär das Klasse ( damals gabs noch Growl was aber eingestellt wurde)… Nutze MAC OS

Sooo ich hoffe ich konnt mich verständlich ausdrücken. Und es gibt genug Kontext zum ersten Post.

Und DANKE Schön ❗

Last edited by Marvel; 02.11.2021 at 20:07.
Reply With Quote
  #1979  
Old 02.11.2021, 20:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Marvel: Ich brauch für Punkt 2.)
Quote:
DOWNLOAD DANN EINFACH STOPPEN WÜRDE, und nicht bei 0Kbs hänglen bliebe.
ein Log, siehe https://support.jdownloader.org/Know...d-session-logs und dann logID hier posten. Spätestens nach dem Read-Timeout sollte der Read vom Netzwerk zurückkommen. Passiert das nicht, dann hängt der irgendwo in nem Treiber/in deinem VPN und dann kann JDownloader nicht "einfach stoppen".

Evtl kannst du im VPN Client was verstellen? Zb TCP/UDP oder VPN Protokol?

Quote:
Originally Posted by Marvel View Post
hab ich festgestellt reduzieren die Geschwindigkeit des Downloads und Leider auch ist JD, dann auch, Crash anfälliger.
das während der Download läuft, JD im Crasht.
..JD gecrasht ist und eigentlich kein Download lief, was zum Kotzen war.
Der JDownloader darf gar nicht crashen! Eigentlich sollte er gar nicht crashen, egal ob Entpacken/Downloaden usw gleichzeitig.

Das klingt mir sehr nach :
a.) nicht genug Speicher für Java.Zb viele Links im JDownloader oder viele MaxDownloads/MaxChunks. Bitte mal einen Screenshot des About Dialogs vom JDownloader und bei crashes muss es hs_err Dateien im JDownloader Ordner geben. Diese bitte an support@jdownloader.org
b.) hardware/treiber/xy Probleme.


@Marvel:
Warum nicht per Handy erinnern lassen? Gibt ja genug Dienste/Apps zu denen man Events/Messages schicken kann und die dann auf dem Handy/der Uhr angezeigt werden. Anstatt per Sound Notification?
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 02.11.2021 at 20:33.
Reply With Quote
  #1980  
Old 02.11.2021, 20:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Marvel: Kurz: du willst einfach per Ton bei bestimmten Events benachrichtig werden?
mp3 in wav solltest du relativ easy mit ffmpeg konvertieren können und du kannst, sofern der Ton nicht via Java abgespielt wird, jedes Format nehmen und musst dafür lediglich einen externen AudioPlayer nehmen, evtl gibts da was *einfaches* für MacOS?
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 02.11.2021 at 20:36.
Reply With Quote
  #1981  
Old 02.11.2021, 20:42
Gbyte Gbyte is offline
I will play nice!
 
Join Date: Nov 2021
Posts: 4
Default

Quote:
Originally Posted by Jiaz View Post
@Gbyte: can you please be more specific? extraction path of? generic path? of a specific archive?
I mean this one. And sry, didnt know there were more ,:)
Attached Images
File Type: png f18a25a7.png (49.8 KB, 10 views)
Reply With Quote
  #1982  
Old 02.11.2021, 21:29
Marvel Marvel is offline
Baby Loader
 
Join Date: Oct 2021
Posts: 5
Default

@Jiaz dazu muss das ding dann im selben Netz sein oder gar ne Email geschickt werden,

mh wollte keine Weiteren Ports aufmachen oder ne Email schicken,

aber Event Messages noch nie benutzt (MYJdownloader Account nötig oder)

Aber schreib mal was du für gute Dienste kennts oder nutzt

Lieber wär mir,

Ja Ton Benachrichtigung, also ich hab Media human Konverter benutzt um zu konvertieren, aber ich denke das java das nicht abspielt.... habs aber nicht weiter eingrenzen können. weiss nur das es nichtgekalppt hat auch mit den einfacheren tönen in Mac OS Probiert hat kein tönchen ausgegeben..

würd mich interressieren wie das Bei WIN und co soo ist.... ob die das dort abspielen,
dann würd ich es mit dem selben Programmausprobieren, auf MAC OS

mhhh externen Audioplayer zum abspielen gern, aber wie das in das Script einbauen Quicktime-VLC nutzen wär klasse wenn das geht..,

denke wenn du das mal auf Win oder was auch immer mal ausprobieren könntest ob das abgespielt würd und was du zum konvertieren genutzt hast, wär das mal ein ansatz.
auch als ich wav file den selbennamen geben habe "Captcha".wav hat es das nicht abgespielt, auch gleichen Audio kbs werte übernommen hatte. hatte dafür MediaInfo genutzt um zu sehen was das für Audio werte sind um sie einzustellen.

Beim Rest Crash und Coo muss ich noch Nachsehen, ja der RAM speicher ist mit der Zeit schnell gefüllt, aber auch als ich einen Neuen JD aufegsetzt habe hat es nicht geholfen, könntest recht haben sind mehr als 2300 Files vorhanden

Das mit dem Timeout ist keine Schlechte Idee hab da was gefunde das die verbindung trennt... und wenn da JD Stoppt hätt ich einen Ton..... muss nachsehen wie ich das testen kann...

Gruss und Guten Abend auch

Update: hab VPN Verbindung bei inaktivität trennen gefunden, aber leider leider trennt es die Verbindung trotz Download , wird verbuggt sein. falls du noch einen anderen Workaround kennts, nur Zu..

Last edited by Marvel; 02.11.2021 at 23:26.
Reply With Quote
  #1983  
Old 03.11.2021, 08:58
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by JDL1059 View Post
... using a text file and pasting the ... links there ... run a script to check that text file occasionally and import any new downloads.
Code:
/*
    Interval > Add urls
    Trigger : Interval (Recommended 3600000 or more)
*/

var file = "c:\\downloads\\urls.txt";// <- Set path to text file

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

    callAPI("linkgrabberv2", "addLinks", {
        links: links
    })
} catch (e) {};
Reply With Quote
  #1984  
Old 03.11.2021, 12:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by Marvel View Post
... please explain witch Programm I need to convert a Sound in wav if mp3 not working.
You can just use ffplay from JD/tools folder to play audio files of any format:
Code:
callSync("path/to/ffplay", "path/to/audiofile", "-nodisp", "-autoexit");
Reply With Quote
  #1985  
Old 03.11.2021, 13:12
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Gbyte:
Extraction.customextractionpathenabled
and
Extraction.customextractionpath
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1986  
Old 03.11.2021, 13:15
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@Marvel: Du musst keinerlei Ports öffnen um irgendwelche Notification Dienste zu nutzen. Du sendest ja Requests weg und willst nicht einen Port aufmachen.
Und nein, das *Ding* muss nicht im selben Netz sein. Gibt doch genug Dienste/Apps die du aufm Computer/Handy installieren kannst und dann via API Events schicken kannst welche dann angezeigt werden.
Kurze Suche im Netz, zb
pushover.net
mobiloud.com/blog/best-push-notification-services
"ja der RAM speicher ist mit der Zeit schnell gefüllt" -> Nutzt du Mac 12? Da gibts aktuell nen Memleak Bug der nahezu alle Anwendungen betrifft. Dort musst auf MacOS Update warten.
Bzgl. VPN , evtl mal nen anderen Anbieter/oder Tool probieren? Sind ja meist offene/gleichen Protokolle, also könntest andere Clients nehmen
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1987  
Old 03.11.2021, 15:53
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Post Avoid duplicates at same path

I've been working on a script I asked about earlier to handle dealing with potential duplicates after changing the YouTube plugin Filename for Video files setting. The old setting was the default. The new setting has *CHANNEL* followed with Channel_.

*CHANNEL* Channel_*VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*).*EXT*

Below is what I have so far. I now need to figure out (the commented non-code below) how to check if the old file exists and if it's within 5 MB of the new file (best guess it's the same file because of YouTube's file size variations). The trigger is on a download started. I think I'm getting closer and will keep at it, but any advice would be appreciated. Thanks!

Code:
var newFileName = link.getName();
var oldFileName = newFileName.substring(newFileName.indexOf("Channel_") + 8);

var folderPathOnly = link.package.downloadFolder;
var folderPathWithNewFile = link.getDownloadPath();
var folderPathWithOldFile = getPath(folderPathOnly + "/" + oldFileName);

//if folderPathWithOldFile already exists
//	if old file size within 5 MB of new file size
//		link.setEnabled(false);
//              (bonus: and rename old file to newFileName)
Reply With Quote
  #1988  
Old 03.11.2021, 16:40
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Default

Quote:
Originally Posted by mrjjones View Post
I've been working on a script I asked about earlier to handle dealing with potential duplicates after changing the YouTube plugin Filename for Video files setting...
Okay, last reply for a while. I need a break. This stuff is hard for me. The only major part left is checking if the old and new file size is within 5 MB. I really have no idea where to start with that.

Code:
var newFileName = link.getName();
var oldFileName = newFileName.substring(newFileName.indexOf("Channel_") + 8);

var folderPathOnly = link.package.downloadFolder;
var folderPathWithNewFile = getPath(link.downloadPath);
var folderPathWithOldFile = getPath(folderPathOnly + "/" + oldFileName);
var folderPathWithOldFileExists = folderPathWithOldFile.exists();
var oldFileSize = folderPathWithOldFile.getSize();
var newFileSize = folderPathWithNewFile.getSize();

if (folderPathWithOldFileExists === true ) {
    link.setEnabled(false);
    link.setComment("OLD FILE EXISTS");
    package.setComment("OLD FILE EXISTS");
};


//	also above if condition: old file size within 5 MB of new file size
//		link.setEnabled(false);
//              (bonus: and rename old file to newFileName)
Reply With Quote
  #1989  
Old 03.11.2021, 17:00
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by mrjjones View Post
...how to check if the old file exists and if it's within 5 MB of the new file ...
Code:
/*
    Dupe check
    Trigger: A download started
*/    

var old = getPath(link.downloadPath.replace(/(.+\\).+Channel_(.+)/, "$1$2"));

if (old.exists()) {
    var diff = Math.abs(link.bytesTotal - old.size);
    var target = 1024 * 1024 * 5;

    if (diff < target) {
        link.enabled = false;
        old.renameName(link.name);
    }
}
Reply With Quote
  #1990  
Old 03.11.2021, 20:17
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Default

Quote:
Originally Posted by mgpai View Post
Code:
/*
    Dupe check
    Trigger: A download started
*/    

var old = getPath(link.downloadPath.replace(/(.+\\).+Channel_(.+)/, "$1$2"));

if (old.exists()) {
    var diff = Math.abs(link.bytesTotal - old.size);
    var target = 1024 * 1024 * 5;

    if (diff < target) {
        link.enabled = false;
        old.renameName(link.name);
    }
}

@mgpai this is absolutely perfect. Thank you so much.

I'm also going to add the *VIDEOID* for new files at the end of the name before the extension to further make them unique going forward. I just need to figure out how to change your var old line to also remove the VIDEOID at the end to check the old file.

*CHANNEL* Channel_*VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*) ID_*VIDEOID*.*EXT*
Reply With Quote
  #1991  
Old 03.11.2021, 23:31
mrjjones mrjjones is offline
Vacuum Cleaner
 
Join Date: Nov 2021
Posts: 17
Default

Quote:
Originally Posted by mrjjones View Post
I'm also going to add the *VIDEOID* for new files..
Okay, got that set. Below is pretty much the final code. Thanks so much mgpai.

Trigger is on download started. YouTube plugin file name is:

*CHANNEL* Channel_*VIDEO_NAME* (*H*p_*FPS*fps_*VIDEO_CODEC*-*AUDIO_BITRATE*kbit_*AUDIO_CODEC*)_VidID*VIDEOID*IDEND.*EXT*

Code:
disablePermissionChecks();
var newFileName = link.getName();
package.setName(newFileName);

var oldFile = getPath(link.downloadPath
    .replace(/(.+\\).+Channel_(.+)/, "$1$2")
    .replace(/(_VidID)(.+)(IDEND)/, "")
    );

var newFileSize = link.getBytesTotal();
var oldFileSize = oldFile.getSize();

if (oldFile.exists()) {
    var diff = Math.abs(link.bytesTotal - oldFile.size);
    var target = 1024 * 1024 * 5;

    if (diff < target) {
        link.enabled = false;
        oldFile.renameName(link.name);
        link.setComment("Old file exists. Skipped and renamed. - Old/New size: " + oldFileSize + " / " + newFileSize);
        package.setComment("Old file exists. Skipped and renamed. - Old/New size: " + oldFileSize + " / " + newFileSize);
        alert("Old file exists. Skipped and renamed.\n\n" + oldFileSize + " (old size)\n" + "   " + oldFile + "\n\n" + newFileSize + " (new size)\n" + "   " + newFileName);
    }
}
I'm just now going to try and get the file sizes in the alerts to display in MB but I think mgpai has given me some clues. Thanks everyone for the help.
Reply With Quote
  #1992  
Old 04.11.2021, 11:44
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Hi guys,

Good day! Is there a way to display the trigger interval countdown on the status bar or something? Just want to have an idea when the trigger would run next time.
Reply With Quote
  #1993  
Old 04.11.2021, 15:04
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,290
Default

@reddy.shyam: Not yet possible/supported but I think it's a good feature request.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1994  
Old 04.11.2021, 15:35
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: Not yet possible/supported but I think it's a good feature request.
Hi @Jiaz,

Oh, Wow! Can't belive I am that smart to come up with ideas!

Thank you. Will follow up the request.
Reply With Quote
  #1995  
Old 04.11.2021, 15:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by reddy.shyam View Post
Is there a way to display the trigger interval countdown on the status bar or something? Just want to have an idea when the trigger would run next time.
What kind of script? How often does it trgger?
Reply With Quote
  #1996  
Old 04.11.2021, 15:41
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by mgpai View Post
What kind of script? How often does it trgger?
Hi @mgpai, the script to randomize the downloads which you helped me earlier with. At the moment running every 10 minutes but I would like to see when it would trigger next time please.
Reply With Quote
  #1997  
Old 04.11.2021, 16:14
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by reddy.shyam View Post
... I would like to see when it would trigger next time please.
Add this code at the end of the existing script.
Code:
/*
    Append next execution time to script name
*/    

var name = "reddy.shyam"; // <- Set name of the script (case-sensitive)
var scripts = getScripts();

scripts.forEach(function(script, index) {
    try {
        if (script.name.indexOf(name) > -1) {
            var ets = script.eventTriggerSettings;
            var date = new Date(ets.lastFire + ets.interval).toString().substr(4, 20);

            scripts[index].name = name + " | Next execution: " + date;
        }
    } catch (e) {};
})

setScripts(scripts);

function getScripts() {
    return callAPI(
        "config", "get",
        "org.jdownloader.extensions.eventscripter.EventScripterConfig",
        "cfg/org.jdownloader.extensions.eventscripter.EventScripterExtension",
        "Scripts"
    );
}

function setScripts(scripts) {
    callAPI(
        "config", "set",
        "org.jdownloader.extensions.eventscripter.EventScripterConfig",
        "cfg/org.jdownloader.extensions.eventscripter.EventScripterExtension",
        "Scripts", scripts
    );
}
Reply With Quote
  #1998  
Old 04.11.2021, 16:22
reddy.shyam reddy.shyam is offline
Fibre Channel User
 
Join Date: Aug 2013
Posts: 123
Default

Quote:
Originally Posted by mgpai View Post
Add this code at the end of the existing script.
Code:
/*
    Append next execution time to script name
*/    

var name = "reddy.shyam"; // <- Set name of the script (case-sensitive)
var scripts = getScripts();

scripts.forEach(function(script, index) {
    try {
        if (script.name.indexOf(name) > -1) {
            var ets = script.eventTriggerSettings;
            var date = new Date(ets.lastFire + ets.interval).toString().substr(4, 20);

            scripts[index].name = name + " | Next execution: " + date;
        }
    } catch (e) {};
})

setScripts(scripts);

function getScripts() {
    return callAPI(
        "config", "get",
        "org.jdownloader.extensions.eventscripter.EventScripterConfig",
        "cfg/org.jdownloader.extensions.eventscripter.EventScripterExtension",
        "Scripts"
    );
}

function setScripts(scripts) {
    callAPI(
        "config", "set",
        "org.jdownloader.extensions.eventscripter.EventScripterConfig",
        "cfg/org.jdownloader.extensions.eventscripter.EventScripterExtension",
        "Scripts", scripts
    );
}
Oh, Wow! Thanks @mgpai. You are faster than light! I have set this and did a test run. It asked for permission which I allowed. Oh! I see it under event scripter along side name. Pretty good that one. Any chance to see it on status bar please otherwise I will have to goto settings to see the same?

Last edited by reddy.shyam; 04.11.2021 at 16:24.
Reply With Quote
  #1999  
Old 04.11.2021, 16:30
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by reddy.shyam View Post
Can you tell me please?
It is currently configured to append the next execution time to the script name. Each time it is executed, the next execution time will be appended to the script name in the eventscripter panel.

If your current script name is reddy.shyam (you have to set the current name in the script), it will be renamed to reddy.shyam | Next execution: Nov 04 2021 15:46:59.
Reply With Quote
  #2000  
Old 04.11.2021, 16:34
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by reddy.shyam View Post
Any chance to see it on status bar please otherwise I will have to goto settings to see the same?
You will have to wait for Jiaz to implement it. I can provide a script which can append it to the title bar.
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 22:22.
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.