JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 06.01.2021, 16:47
mikk88 mikk88 is offline
Super Loader
 
Join Date: Dec 2020
Posts: 29
Default [EventScripter] Suspend downloads while Linkgrabber is busy

Hello,

I'm sometimes downloading from hosters with a download limit which I get around using the reconnect feature for getting a new IP.
To avoid any linkgrabber jobs from failing and getting into trouble because of having no network connectivity during a reconnect (takes ~15 seconds), I would like to suspend all downloads (so also no reconnect would trigger) for as long as the LinkGrabber is busy.

I saw that the Eventscripter has an event "New Crawler Job" in which I could stop all downloads. But there seems to be no event for "All crawling jobs finished" which could be used to re-enable the downloads again afterwards?

Are there any options available to make JD behave like this?

Cheers and thanks in advance!
Reply With Quote
  #2  
Old 06.01.2021, 16:49
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,140
Default

I was just about to say: EventScripter.

Unfortunately I'm not that familiar with it so you'll need to wait for an answer of either Jiaz or mgpai.

-psp-
EDIT

Okay I might have misunderstood you in the first place - you want to avoid reconnects interrupting the LinkGrabber?
__________________
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?

Last edited by pspzockerscene; 06.01.2021 at 16:52.
Reply With Quote
  #3  
Old 06.01.2021, 16:55
mikk88 mikk88 is offline
Super Loader
 
Join Date: Dec 2020
Posts: 29
Default

yeah thats the ultimate goal. when my downloads are busy it will reconnect at random times whenever the download limit is reached .. during the reconnect there will be no network for some time which would affect the LinkGrabber if it is just busy crawling for links (I guess?).

Both things are automatic running (crawljobs being added from a script, reconnects whenever JD decides its needed).
Reply With Quote
  #4  
Old 06.01.2021, 17:08
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 71,140
Default

To be honest I've always thought JD would already auto handle this but I'am wrong - I guess maybe it was ignored because most crawljobs are processed quickly or most of them were back then ... but I get your point.
If you add a large amount of URLs and/or e.g. let JD crawl a complete twitter profile this can lead to issues.
Maybe a setting for this in the Reconnect setting would even make sense ...

-psp-
__________________
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?

Last edited by pspzockerscene; 06.01.2021 at 17:17.
Reply With Quote
  #5  
Old 06.01.2021, 17:25
mikk88 mikk88 is offline
Super Loader
 
Join Date: Dec 2020
Posts: 29
Default

I must admit its more a theoretical problem I thought of, nothing that I actively saw happening yet.

A setting in the LinkGrabber or in the Reconnect might work too yeah. Or an event in the Eventscripter to trigger that the LinkGrabber is not busy anymore.
Reply With Quote
  #6  
Old 06.01.2021, 17:37
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Quote:
Originally Posted by mikk88 View Post
Or an event in the Eventscripter to trigger that the LinkGrabber is not busy anymore.
You can use the isCrawling and isCollecting MYJD API methods to check/wait for crawling/collecting activity using the eventscripter 'sleep' method in a while loop with 'Before a Reconnect" trigger.
Reply With Quote
  #7  
Old 06.01.2021, 17:56
mikk88 mikk88 is offline
Super Loader
 
Join Date: Dec 2020
Posts: 29
Default

These were not even mentioned in the eventscripter help, I never saw this other API yet.
I will sure check it out tomorrow. Thanks for the hint!
Reply With Quote
  #8  
Old 07.01.2021, 14:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,342
Default

At the moment there is no out-of-the-box support for reconnect to wait for linkcrawler to finish
__________________
JD-Dev & Server-Admin
Reply With Quote
  #9  
Old 07.01.2021, 14:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,342
Default

@mikk88: I'm sure mgpai can help you with this or check out existing scripts here https://board.jdownloader.org/showthread.php?t=70525
__________________
JD-Dev & Server-Admin
Reply With Quote
  #10  
Old 07.01.2021, 16:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,533
Default

Code:
/*
    Wait while linkcrawler/linkcollector is active
    Trigger: Before a Reconnect
*/

while (
    callAPI("linkcrawler", "isCrawling") ||
    callAPI("linkgrabberv2", "isCollecting")) {
    sleep(10 * 1000); // check state every 10 seconds
}
Reply With Quote
  #11  
Old 08.01.2021, 02:07
mikk88 mikk88 is offline
Super Loader
 
Join Date: Dec 2020
Posts: 29
Default

wow thanks mgpai!
that looks easier than I thought, very cool
Reply With Quote
  #12  
Old 08.01.2021, 12:37
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,342
Default

@mgpai: Thanks for small/easy/great solution/workaround
__________________
JD-Dev & Server-Admin
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:15.
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.