JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #761  
Old 05.06.2019, 16:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

Quote:
Originally Posted by JDFan View Post
I really like INI files. And JSON, too. Scripter support?
What do you mean by that? You can read/write with api methods and toJSObject/toJson. you should also be able to use JSON methods
__________________
JD-Dev & Server-Admin
Reply With Quote
  #762  
Old 05.06.2019, 19:50
bobolecoco bobolecoco is offline
JD Alpha
 
Join Date: Aug 2015
Location: France
Posts: 24
Default

Quote:
Originally Posted by Spyro70 View Post
I would like create a script to download some steaming with a scheduler that consider days, hours and minutes. I am not a programmer...can tell me how I can work out it?
What do you want to do exactly ?
Is the stream url always the same ?
What do you mean with days hours minutes (launch the download every "D" days, at "H" hour and "M" minutes / wait "D" days, at "H" hour and "M" minutes before running / launch the download every "a day of the week (Friday for example)", at "H" hour and "M" minutes) ?
Depending on your answer answer will not be the same. And you could/should consider using "folderwatch" to download a file when it's available.
Reply With Quote
  #763  
Old 05.06.2019, 22:23
bingo bingo is offline
Baby Loader
 
Join Date: Jan 2019
Posts: 6
Default

Hi ,

i would like a script that would allow me to download just a small chunk of lots of files (maybe 1 or 10 MB) (and possibly auto delete them afterwards as well)
Reply With Quote
  #764  
Old 06.06.2019, 11:18
bobolecoco bobolecoco is offline
JD Alpha
 
Join Date: Aug 2015
Location: France
Posts: 24
Default

Quote:
Originally Posted by bingo View Post
Hi ,

i would like a script that would allow me to download just a small chunk of lots of files (maybe 1 or 10 MB) (and possibly auto delete them afterwards as well)

Is something like this what you want ?
Code:
var numberOfMB = 10

for (i = getAllDownloadLinks().length - 1; i >= 0; i--) {
    if (getAllDownloadLinks()[i].getBytesLoaded() > numberOfMB * 1024 * 1024) {
        getAllDownloadLinks()[i].setEnabled(false);
    }
}
It will check if more than (here 10) MB of the file are already downloaded. If that's the case, it will disable the link.

You can add this line (after or instead of "getAllDownloadLinks()[i].setEnabled(false);") :
Code:
removeDownloadLinkByUUID(getAllDownloadLinks()[i].getUUID());
//or
getAllDownloadLinks()[i].remove();
It will remove the link from the download list.

You can also look for the deleteFile() method to erase the downloaded file in combination with the getPath() method.
Reply With Quote
  #765  
Old 06.06.2019, 11:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

@bobolecoco: you're trying to become new master of eventscripter mgpai will be great teacher to you
Thanks for helping out!
__________________
JD-Dev & Server-Admin
Reply With Quote
  #766  
Old 06.06.2019, 12:23
bobolecoco bobolecoco is offline
JD Alpha
 
Join Date: Aug 2015
Location: France
Posts: 24
Default

I'm pretty sure mgpai will have a better script than mine !
And trying to solve somebody else problems teaches me how to use the eventscripter too.
Reply With Quote
  #767  
Old 06.06.2019, 13:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

Great things you will learn, young padawan Proud mgpai will be of you
__________________
JD-Dev & Server-Admin
Reply With Quote
  #768  
Old 06.06.2019, 16:53
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 948
Default

Quote:
Originally Posted by mgpai View Post
True, but I am not comfortable helping anyone scam the hosters. If (I feel) the requirement is legitimate (as in this case), I will try to help in any way I can.
Okay, good. Special case filecrypt and too much links in one hour. I have already requested better proxy support.

Had the days a closer look at the Event Scripter, I can't do the proxy list there, especially sorting, adding and deleting proxies? Or did I overlook a function (call api?)?

Especially with Filecrypt this would be helpful if after e.g. 10 calls another proxy would be moved up by sorting. Otherwise I have an error 404 (returned by Filecrypt) although it would be available.

EDIT: Solved. (call api read/write with InternetConnectionSettings.customproxylist)
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.

Last edited by thecoder2012; 06.06.2019 at 17:07.
Reply With Quote
  #769  
Old 06.06.2019, 17:01
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

Quote:
Originally Posted by thecoder2012 View Post
Especially with Filecrypt this would be helpful if after e.g. 10 calls another proxy would be moved up by sorting. Otherwise I have an error 404 (returned by Filecrypt) although it would be available.
At the moment there is no trigger for *after 10 calls*.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #770  
Old 06.06.2019, 18:29
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 611
Default

Quote:
Originally Posted by thecoder2012 View Post
Especially with Filecrypt this would be helpful if after e.g. 10 calls another proxy would be moved up by sorting.
@Jiaz: How does GeneralSettings.freeproxybalancemode CYCLE work? If the term CYCLE is used in literal sense, would it not mean it will use one proxy after another (in the order they are listed), for each new connection, till it reaches the end of the list and start again from the top?, in which case if this option is selected, will there be a need to sort?
Reply With Quote
  #771  
Old 06.06.2019, 18:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

@mgpai: this one only works for downloads and yes, one after another
__________________
JD-Dev & Server-Admin
Reply With Quote
  #772  
Old 06.06.2019, 18:50
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 611
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: this one only works for downloads and yes, one after another
I have noticed (also just tried) that if the decrypter (filecrypt.cc in this case) is blacklisted in the direct connection, it will use proxies. Will it cycle for the decrypter in such cases or does it keep only using the first proxy in list. In other words is there a workaround to cycle proxies with decryrpters, or does it only work strictly with downloads?
Reply With Quote
  #773  
Old 06.06.2019, 20:21
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 948
Default

Quote:
Originally Posted by mgpai View Post
I have noticed (also just tried) that if the decrypter (filecrypt.cc in this case) is blacklisted in the direct connection, it will use proxies.
Yes.

Quote:
Originally Posted by mgpai View Post
Will it cycle for the decrypter in such cases or ...
I think no.

Quote:
Originally Posted by mgpai View Post
... does it keep only using the first proxy in list. In other words is there a workaround to cycle proxies with decryrpters, or does it only work strictly with downloads?
With decrypters, nope. GeneralSettings.freeproxybalancemode is ONLY for downloads. Other functions only using the first good proxy in the list.

First the small export function in js for crazy config places.
Code:
writeFile(JD_HOME + "/tmp/biglist.json", JSON.stringify(callAPI("config", "list"),undefined,4), false);
Proxy list is under updatev2 says the list function.

My linkgrabber proxy cycle script:
Code:
// LinkGrabber Proxy cycle
// Trigger required: "New Crawler Job"

var old_proxylist = [];
var new_proxylist = [];
var first_active = "";

var settings = "org.jdownloader.updatev2.InternetConnectionSettings";
var storage = "cfg/org.jdownloader.settings.InternetConnectionSettings";
old_proxylist = callAPI("config", "get", settings, storage, "customproxylist");

for (var key in old_proxylist) {
    if (old_proxylist.hasOwnProperty(key)) {
        if (old_proxylist[key].enabled == true && first_active == "") {
            first_active = old_proxylist[key];
        } else {
            new_proxylist.push(old_proxylist[key]);
        }
    }
}
new_proxylist.push(first_active);
callAPI("config", "set", settings, storage, "customproxylist", new_proxylist);
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.
Reply With Quote
  #774  
Old 06.06.2019, 21:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 611
Default

@Jiaz: Thanks for the reply.
@thecoder2012: Thanks for the response. Good to see you found a nice solution to your problem.
Reply With Quote
  #775  
Old 07.06.2019, 00:19
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 948
Default

Quote:
Originally Posted by mgpai View Post
@Jiaz: Thanks for the reply.
@thecoder2012: Thanks for the response. Good to see you found a nice solution to your problem.
Next question. I have the PluginException.LinkStatus.ERROR_RETRY,
PluginException.LinkStatus.ERROR_IP_BLOCKED,
PluginException.LinkStatus.ERROR_HOSTER_TEMPORARILY_UNAVAILABLE or
PluginException.LinkStatus.ERROR_TEMPORARILY_UNAVAILABLE in the hoster-/downloadplugin (e.g. shareonline) but in the Event Scripter is "getStatus()"+"getSkippedReason()"+"getFinalLinkStatus()" only "null", why?
getEta() has the (retry or maintenance) time or "-1" with IP_BLOCKED.

I have no problem with ERROR_FATAL, ERROR_PLUGIN_DEFECT, ERROR_CAPTCHA and ERROR_FILE_NOT_FOUND in the Event Scripter.

Code Example:
Code:
var links = getAllDownloadLinks();
for (i = 0; i < links.length; i++) {
        var link = links[i];
        alert(link.getEta() + " 1:" + link.getStatus() + " 2:" + link.getSkippedReason() + " 3:" + link.getFinalLinkStatus());
}
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.

Last edited by thecoder2012; 14.06.2019 at 00:23.
Reply With Quote
  #776  
Old 11.06.2019, 15:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

@thecoder2012: those LinkStatus are only used for signals between Controller-Plugin.
getStatus returns String that is internally created for human readonly
getSkippedReason returns final SkippedReason
getFinalLinkStatus returns final FinalLinkState
temp/conditional skip reasons are only *reachable* via getStatus and ONLY when controller assigned the status to the file.

What are you trying to find out? Best would be to contact me via support@jdownloader.org so we can do tech chit/chat
__________________
JD-Dev & Server-Admin
Reply With Quote
  #777  
Old 12.06.2019, 21:03
D.IKE.E D.IKE.E is offline
JD Alpha
 
Join Date: Jun 2013
Posts: 21
Question File on HDD <> Linkgrabber comparision

Does anybody know a way to compare links in linkgrabber with files on my hard drive to avoid downloading files I already have (which were not downloaded through JD)? Since linkgrabber only fetches file sizes it's the only - but perhaps good enough - comparable file attribute. The results of such a search/comparison can also be manually checked about if file names are similar. The idea grew from the usage of the tool AllDup (alldup.de/alldup/en_alldup_screenshots.php)
Reply With Quote
  #778  
Old 13.06.2019, 18:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 611
Default

Quote:
Originally Posted by D.IKE.E View Post
... avoid downloading files I already have ...
You can use a script like this to check/disable the link if it already exists on disk. That script only checks for duplicate file name, but a file size comparison can also be added to it.
Reply With Quote
  #779  
Old 14.06.2019, 00:25
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Official 9kw.eu Support
 
Join Date: Feb 2013
Location: Internet
Posts: 948
Default

Quote:
Originally Posted by Jiaz View Post
What are you trying to find out?
Faster reset/repeat of waiting times than e.g. retry in 15 minutes or 3 hours (uploaded test).

Quote:
Originally Posted by Jiaz View Post
temp/conditional skip reasons are only *reachable* via getStatus and ONLY when controller assigned the status to the file.
Okay and there is no chance if the controller has it not? (SO with temp/conditional skip reasons e.g. IP_BLOCKED, HOSTER_TEMPORARILY_UNAVAILABLE, TEMPORARILY_UNAVAILABLE)

Little better example with uploaded link "uploaded.net/file/xa23c1bz" (start the download, click on stop and try it again, then you have "Download limit has been reached" but NO status or eta in the Event Scripter.

JD Screenshot:


Event Scripter
Code:
var links = getAllDownloadLinks();
for (i = 0; i < links.length; i++) {
    var link = links[i];
    if (link.isEnabled()) {
        alert(link.getHost() + " 0:" + link.getEta() + " 1:" + link.getStatus() + " 2:" + link.getSkippedReason() + " 3:" + link.getFinalLinkStatus());
    }
}
Screenshot:


But I see the reason in myjd:

Can I grab it (e.g. "Download limit has been reached") with other function/callapi?
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.

Last edited by thecoder2012; 14.06.2019 at 12:09.
Reply With Quote
  #780  
Old 14.06.2019, 12:09
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 65,382
Default

should be fixed with next core update
__________________
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 13:54.
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 - 2019, Jelsoft Enterprises Ltd.