#1
|
|||
|
|||
[EventScripter] Filter download list with file_size/video_length "on the go"
Hello,
I have a lot of files in my downloadlist. I have fast link check enabled, so the file sizes are not visible until i perform link check or start the download. (And I do not want to perform link check first, bcos it will take a long time, instead i would like to filter while downloading.) I would like to filter the download list by file size, and only download files less than, say 20mb. Is there a way to filter on-the-go? If not would you be open to adding it. Basically, i want to be able to just set the file size limit somewhere, then start the download, it will perform the linkcheck and get the file size, if the file size is less than the threshold it will be downloaded, otherwise the file will be disabled/skipped (not deleted). If possible, i would also like this to work with video lengths. So, i can set up the filter - file.size < 20mb || video.length < 5min (here i am using || because I assume that it will only be possible to get video length from some hosts and not all, so in that case file.size would work.) |
#2
|
||||
|
||||
Eventscripter -> Interval script that checks all running downloads and aborts/skips them on certain conditions
-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
#3
|
|||
|
|||
I came up with this
(function() { if (!getRunningDownloadLinks().length) return; var bytesLoaded = 0; getAllDownloadLinks().forEach(function(link) { if(!link.isFinished() && link.getBytesLoaded() > 0 && link.getBytesTotal() >= 10*1024*1024) link.setSkipped(true); }); })(); Can it be simplified or optimized? |
#4
|
|||
|
|||
Code:
/* Trigger : A Download Started */ while (link.isRunning() && link.getBytesTotal() == -1) { sleep(1000); } if (link.getBytesTotal() >= 1024 * 1024 * 20) { link.setEnabled(false); } |
#5
|
|||
|
|||
Quote:
Thank you |
Thread Tools | |
Display Modes | |
|
|