JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #2261  
Old 09.06.2022, 16:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Jiaz View Post
Yes, because the packagizer script then *blocks* the linkcrawler thread
Wasn't aware of this. Good to know.

Quote:
Originally Posted by pspzockerscene View Post
Until now no one has needed this.
Maybe it's better to wait until a real use case exists.
It is indeed difficult to create a one-size-fits-all script for edge cases.
Reply With Quote
  #2262  
Old 09.06.2022, 16:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by xefeg View Post
Script Request - Split larger than x_size and move them to folder
You will have to use external programs which support CLI and call it in eventscripter. If you need help adding them to a script, post the terminal commands which you are currently using.
Reply With Quote
  #2263  
Old 09.06.2022, 18:56
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

Quote:
Originally Posted by mgpai View Post
A file in 'timestamp.tsv' format will be created in JD folder. Example (j:\Apps\Jdownloader\1654782759265.tsv)
Code:
var file = JD_HOME + "/" + Date.now() + ".tsv";

It is also possible to create a script which can export the entire list using a different trigger, for example on toolbar button press, without having to select any links.
OK, thank you very much!
Should have searched there in the first place

Yes, it would be nice to have another button (another script) which exports the entire list.

And a few more questions, if I may...

1. Would it be possible to use below format instead?
2022-06-09-16-09-30-868.tsv

2. I believe, this
Code:
var file = JD_HOME + "/"
is the path definition.
So, I could add a fixed path instead of JD_HOME, right?

3. If this is not too much, could you please add code to create some sort of popup confirmation about the file being written successfully.

4. Or would it even be possible to jump to the file automatically?

Thanks for any efforts taken in advance!

Last edited by StefanM; 09.06.2022 at 18:59.
Reply With Quote
  #2264  
Old 10.06.2022, 00:59
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 66,673
Default

Quote:
Originally Posted by mgpai View Post
Since we cannot post any urls or upload any files in the forum, perhaps JD team can host an official repo to share scripts, rules etc.
I'm dreaming about that too :D
__________________
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
  #2265  
Old 10.06.2022, 09:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by StefanM View Post
... a few more questions...
  1. Code:
    new Date().toISOString().replace("Z", "").replace(/[^\d]/g, "-")
  2. Code:
    JD_HOME + "/"
    can be replaced with any folder (existing) string. For example:
    Code:
    "d:/my folder/"
  3. Insert after 'writeFile...' line:
    Code:
    alert("Data exported");
  4. Insert after 'writeFile...'
    Code:
     openURL("file://" + file);
Reply With Quote
  #2266  
Old 10.06.2022, 12:08
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

@mgpai
Do you see any chance to create a script (delays at least for LinkGrabber) now that Jiaz mentioned use of packagaizer hook here to add sleep/wait in linkcrawler.?


Quote:
Originally Posted by StefanM - Full Post: https://board.jdownloader.org/showpo...postcount=2237
Adding (random) delays between requests and/or downloads
Quote:
Originally Posted by mgpai View Post
A. Only possible with downloads or while feeding origin links.
B. Eventscripter does not have access to crawling process.
C. Can use sleep. (Will post example script when @Jiaz adds the new method)

One more option which can help with rate limiting is reduce the linkchecker/linkcrawler threads in advanced settings. Default is 4 and 12. (I use 4 for both)

Quote:
Originally Posted by Jiaz View Post
B.) @mgpai: you could use packagaizer hook here to add sleep/wait in linkcrawler

The best approach is to control it at the plugin level, as suggested by @Jiaz/@psp.



Does it help with rate limit? I thought that is triggered only after crawling/collectiing process is completed.
Reply With Quote
  #2267  
Old 10.06.2022, 12:47
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default List of JD-specific terms for scripts

@mgpai or anyone who knows...

Where can I find a list of JD-specific terms to use in Event Scripter-scripts?

Examples:
  • JD-Program Folder: JD_HOME
  • Name the file downloaded: link.name
  • Size of file downloaded: link.bytesLoaded
  • Path of file downloaded (e.g. on HDD): link.downloadPath
  • URL as added to LinkGrabber: link.url
  • Source revision of Core: CoreRevision
  • ...
Don't even know if all of the above is is correct.
Just tried to figure out from working scripts...

Right now I would like to know below terms (taken from Edit Menu Node for Copy Information button):
(if not already included in the above list)
  • archive.password
  • comment
  • ext
  • filesize
  • filesize_gib
  • filesize_kib
  • filesize_mib
  • filesize_raw
  • hash
  • host
  • jd:prop:yourWishedProperty
  • name
  • name_noext
  • packagename
  • path
  • type
  • url
  • url.container
  • url.content
  • url.origin
  • url.referrer

Thanks for any efforts taken...
Reply With Quote
  #2268  
Old 10.06.2022, 12:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,484
Default

Quote:
Originally Posted by Jiaz View Post
B.) @mgpai: you could use packagizer hook here to add sleep/wait in linkcrawler
Quote:
Originally Posted by Jiaz View Post
Yes, because the packagizer script then *blocks* the linkcrawler thread
Quote:
Originally Posted by StefanM View Post
Do you see any chance to create a script (delays at least for LinkGrabber)
Most likely my initial assumptions were correct, because the packagizer link object is available only after all online checks have been performed. From what I can see it performs all requests related to a job at once and only increases the interval at which the links appear in linkgrabber list. I think it only blocks (not sure about that even) jobs (and thus queues them?) and not requests made within/pertaining to a job. Most importantly it also makes the GUI non-responsive during the sleep interval.

You can test it yourself. No extensive code as such. Create a new script with the following and use it with "Packagizer Hook". (You can restart to kill the script thread if JD stalls)

Code:
sleep(3000); // Delay in milliseconds

Wait for @Jiaz to respond, in case he meant to use it differently.
Reply With Quote
  #2269  
Old 10.06.2022, 14:08
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 66,673
Default

@StefanM
I'd recommend using a system-wide solution to limit requests to certain hosts.
Looks like doing that via EventScripter will be complicated.

I do not have a hint for such applications atm. but I'm quite sure such applications do exist.
__________________
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
  #2270  
Old 10.06.2022, 14:34
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

Quote:
Originally Posted by StefanM View Post
@mgpai or anyone who knows...

Where can I find a list of JD-specific terms to use in Event Scripter-scripts?
You'll find a list of all available Objects/Methods in the helper window above the source editor.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2271  
Old 10.06.2022, 15:52
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

Quote:
Originally Posted by Jiaz View Post
You'll find a list of all available Objects/Methods in the helper window above the source editor.
OK, thanks! Took a closer look at it, but could not find all those terms used by mgpai in his scripts, also not all terms I quoted in my post.

and...
... what does this (just an example) mean?
Code:
var myString = myCrawlerJob.getText()
Sure, it'll be about some text, related to the Crawler Job, that I can see. But nothing more.

What I was looking for, is a list, that I could use to search for strings to be used. Even if we look at a simple things such as the program folder...

If I wouldn't know, what JD_HOME stands for, I would search for
  • 'home directory'
  • 'program folder'
  • 'installation directory'
  • ...

This one I would have found, but others I would not.

Anyway, as you mentioned that these scripts are only meant for developers, who are familiar with Java...

Those developers would probably have it easier...
Will study the list and learn how to find things...

The most important thing is: After 12 years of using JD, you guys finally made me use Event Scripter - first time in 12 years...
Reply With Quote
  #2272  
Old 10.06.2022, 16:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

Quote:
Originally Posted by StefanM View Post
OK, thanks! Took a closer look at it, but could not find all those terms used by mgpai in his scripts, also not all terms I quoted in my post.
for example? The ones from "Copy Information" coincidentally sound the same.
Quote:
Originally Posted by StefanM View Post
Anyway, as you mentioned that these scripts are only meant for developers, who are familiar with Java...
The scripts are Javascript syntax.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2273  
Old 10.06.2022, 16:05
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

Quote:
Originally Posted by StefanM View Post
... what does this (just an example) mean?
Code:
var myString = myCrawlerJob.getText()
When you add links to JDownloader a CrawlerJob contains the links and other information and .getText is a way to access that
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2274  
Old 10.06.2022, 16:10
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

Quote:
Originally Posted by StefanM View Post
If I wouldn't know, what JD_HOME stands for, I would search for ]
It's part of the help above the editor
Quote:
/* ========= Properties =========*/
//JDownloader Installation Directory;
var myString = JD_HOME;
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2275  
Old 10.06.2022, 17:14
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

Quote:
Originally Posted by Jiaz View Post
for example? The ones from "Copy Information" coincidentally sound the same.
Hmmm... No! They are different:
  • filesize_gib
  • filesize_kib
  • filesize_mib
  • filesize_raw

Quote:
Originally Posted by Jiaz View Post
The scripts are Javascript syntax.
I know. And maybe I will learn Javascript syntax some day.

In the meantime I learn by copying, pasting, trial, and error...
Reply With Quote
  #2276  
Old 10.06.2022, 17:17
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

Quote:
Originally Posted by Jiaz View Post
When you add links to JDownloader a CrawlerJob contains the links and other information and .getText is a way to access that
Ok, I see!

But I just mentioned that example to point out that from that list in Event Scripter's 'Help' you cannot really see, what things mean...

But maybe it's clear for somebody familiar with Javascript...
Reply With Quote
  #2277  
Old 10.06.2022, 17:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

Quote:
Originally Posted by StefanM View Post
Hmmm... No! They are different:
  • filesize_gib
  • filesize_kib
  • filesize_mib
  • filesize_raw
those are placeholder for the "Copy information* and has nothing to do with scripts for Eventscripter. There you have access to the number and have to convert to human readable string by yourself
those placeholder is formatted filesize in different units
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2278  
Old 10.06.2022, 17:32
StefanM's Avatar
StefanM StefanM is offline
JD VIP
 
Join Date: Oct 2020
Posts: 447
Default

Quote:
Originally Posted by Jiaz View Post
It's part of the help above the editor
Yes, as I said, I would have found this one by searching for different search strings, with one of them being 'installation directory'.

Just want to try to make you aware of the problems, a user can get encountered with.

To give you another example:
https://support.jdownloader.org/Know...to-jdownloader

It is a great help.
But it was written from the point of view of somebody (psp), who already had Event Scripter installed.

What would the user do?
They would follow the instructions to find out that Event Scripter Trigger from here:



is not available.

Why is it not available? I had to ask this myself!

One important information is missing in that article:
Before you start, you have to install Event Scripter extension...

This is just another example for what I tried to explain before:
For any developer it is more or less difficult, to put themselves in the shoes of a user.
Reply With Quote
  #2279  
Old 10.06.2022, 17:35
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,044
Default

@StefanM
at the beginning of https://support.jdownloader.org/Know...to-jdownloader
Quote:
Install- and activate the Eventscripter in the JDownloader Settings panel.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #2280  
Old 10.06.2022, 17:54
pspzockerscene's Avatar
pspzockerscene pspzockerscene is online now
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 66,673
Default

Quote:
Originally Posted by StefanM View Post
But it was written from the point of view of somebody (psp), who already had Event Scripter installed.
And?
Why would you read the "Add custom EventScripter buttons" article first without even knowing what the EventScripter is?
I do not see any need to adjust the article you've linked.
Instead, I updated our "Uninstall extensions" Article which now also covers the installation of extensions:
https://support.jdownloader.org/Know...all-extensions
I then cross-linked that in the "What is the EventScripter" Article:
https://support.jdownloader.org/Know...event-scripter
...going by your logic we'd have to back-link every article which is part of a specific category. Sorry that makes no sense to me.
If you're viewing an article and you're lost/need more info, just go to the root of the category and check out the other articles.
In case of the EventScripter that would be here:
https://support.jdownloader.org/Know...event-scripter

Quote:
Originally Posted by StefanM View Post
This is just another example for what I tried to explain before:
For any developer it is more or less difficult, to put themselves in the shoes of a user.
You're the first user with this problem.
Don't get me wrong I know it is hard to get the view of our users but really why would you add an EventScripter trigger:
- Without knowing what the EventScripter is
--> Without then at least searching for "EventScripter" in our knowledgebase/forum

Those articles are not- and will never be perfect but in my opinion most of them are understandable although I have to admit in the past we didn't get a lot of feedback about them (neither positive nor negative).
__________________
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

Last edited by pspzockerscene; 10.06.2022 at 17:54. Reason: Fixed typos
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 12:12.
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.