JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #141  
Old 03.08.2017, 16:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@mgpai: very nice and clear solution
__________________
JD-Dev & Server-Admin
Reply With Quote
  #142  
Old 04.08.2017, 04:01
Lpxatreyu
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Time based download control
// Trigger: "Interval" (Recommended: 300000 ms)

var t1 = 2; // <- Set starting Hour (0-23)
var t2 = 8; // <- Set ending Hour (0-23)

var now = new Date();

if (now > time(t1) && now < time(t2)) {
    if (!isDownloadControllerRunning() && downloadsPending()) startDownloads();
} else {
    if (isDownloadControllerRunning()) stopDownloads();
}

//Functions
function time(hour) {
    return new Date().setHours(hour, 0, 0, 0)
}

function downloadsPending() {
    return getAllDownloadLinks().some(function(link) {
        return link.getFinalLinkStatus() == null;
    });
}
Firstly I really appreciate for your fast support sir!
I forgot to mention about little change about my question.How about if i just want to change time i meant put minutes as 02:20 AM or 07:44 like this ?
Thank you for all of you !
Reply With Quote
  #143  
Old 04.08.2017, 04:03
Lpxatreyu
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai: very nice and clear solution
Yes sir it looks working perfect ! Whenever I came your site and asking something i am getting asnwer&solution very quickly thank you for your service!
Reply With Quote
  #144  
Old 04.08.2017, 09:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

@Lpxatreyu: All thanks goes to mgpai
__________________
JD-Dev & Server-Admin
Reply With Quote
  #145  
Old 04.08.2017, 15:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by Lpxatreyu View Post
... How about if i just want to change time i meant put minutes ...
Spoiler:
Code:
// Time based download control
// Trigger: "Interval" (Recommended: 300000 ms)

var t1 = [2, 20]; // <- Set starting time (hours = 0-23, minutes = 0-59)
var t2 = [7, 44]; // <- Set ending time (hours = 0-23, minutes = 0-59)

var now = new Date();

if (now > time(t1[0], t1[1]) && now < time(t2[0], t2[1])) {
    if (!isDownloadControllerRunning() && downloadsPending()) startDownloads();
} else {
    if (isDownloadControllerRunning()) stopDownloads();
}

//Functions
function time(hh, mm) {
    return new Date().setHours(hh, mm, 0, 0)
}

function downloadsPending() {
    return getAllDownloadLinks().some(function(link) {
        return link.getFinalLinkStatus() == null;
    });
}
Reply With Quote
  #146  
Old 05.08.2017, 02:10
Lpxatreyu
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
Spoiler:
Code:
// Time based download control
// Trigger: "Interval" (Recommended: 300000 ms)

var t1 = [2, 20]; // <- Set starting time (hours = 0-23, minutes = 0-59)
var t2 = [7, 44]; // <- Set ending time (hours = 0-23, minutes = 0-59)

var now = new Date();

if (now > time(t1[0], t1[1]) && now < time(t2[0], t2[1])) {
    if (!isDownloadControllerRunning() && downloadsPending()) startDownloads();
} else {
    if (isDownloadControllerRunning()) stopDownloads();
}

//Functions
function time(hh, mm) {
    return new Date().setHours(hh, mm, 0, 0)
}

function downloadsPending() {
    return getAllDownloadLinks().some(function(link) {
        return link.getFinalLinkStatus() == null;
    });
}
Thank you ! Thank you so much...I will try it soon and I don't have any doubt that it won't work Thank you all of you!
Reply With Quote
  #147  
Old 10.08.2017, 22:41
CyanSlinky
Guest
 
Posts: n/a
Default

so i was referred here by Jiaz and was wondering if mgpai or someone could help me automate downloading of new youtube channel videos? maybe grab channels from a text file and check them for new videos somehow? anyways I'd really appreciate it if someone could help me with this.
Reply With Quote
  #148  
Old 12.08.2017, 14:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by CyanSlinky View Post
... automate downloading of new youtube channel videos ...
Script in Post #84 can be used to fetch recent videos from RSS feeds.
Reply With Quote
  #149  
Old 15.08.2017, 18:30
facecat
Guest
 
Posts: n/a
Default

Hi,
Jdownloader is able to moove some specific size files to another folder without script ?
Like
file<2giga into C:\Users\Desktop\small
file>2giga into C:\Users\Desktop\big

If not mgpai can you make me some script if it take you not so much time plz :D
Reply With Quote
  #150  
Old 15.08.2017, 18:32
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

Use Packagizer and create two rules to specify different download locations. Please know that this only works for new added links
__________________
JD-Dev & Server-Admin
Reply With Quote
  #151  
Old 15.08.2017, 19:02
facecat
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Use Packagizer and create two rules to specify different download locations. Please know that this only works for new added links
thx i forgot this one
ps : jd cant see the duration of a file before download ? for making my rule

Last edited by facecat; 15.08.2017 at 19:07.
Reply With Quote
  #152  
Old 15.08.2017, 19:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

You're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #153  
Old 16.08.2017, 08:36
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,627
Default

note: some limitations
some plugins do not give accurate filesize information
some plugins do not offer filesize information

using the eventscripter is the only effective solution, not packagiser.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #154  
Old 16.08.2017, 22:21
facecat
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by raztoki View Post
note: some limitations
some plugins do not give accurate filesize information
some plugins do not offer filesize information

using the eventscripter is the only effective solution, not packagiser.
so is it possible with eventscripter to get the duration of a file and move it into a specific folder ?
because finally the filesize is not accurate for what i want to do
Reply With Quote
  #155  
Old 16.08.2017, 22:30
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,627
Default

@facecat

original query
package customiser will work if
- plugin returns filesize && you use filesize to determine large|small
- plugin returns filename && you use filename to determine large|small
- or you can use other components in which package customiser to determine large|small

event scripter will work
- as post download event, as filesize is a known!
- you can also run it via other applications to do the analytical tasks and moving tasks.

duration? I assume you are now referring to video or audio files? You will need to use 3rd party software like ffmpeg or MediaInfo to determine that information.


raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #156  
Old 16.08.2017, 22:39
facecat
Guest
 
Posts: n/a
Default

yeah duration i mean lenght
sry for my english
Reply With Quote
  #157  
Old 17.08.2017, 21:40
facecat
Guest
 
Posts: n/a
Default

hi
i have mediainfo but idk other software for moving some files without lines of codes
i tried "dropit" but all software like that dont have "lenght" or "duration" rules :(
Reply With Quote
  #158  
Old 18.08.2017, 10:36
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 79,084
Default

I suggest to contact mgpai and ask him for help. so after download check filesize and then move to desired location
__________________
JD-Dev & Server-Admin
Reply With Quote
  #159  
Old 19.08.2017, 08:04
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,495
Default

Quote:
Originally Posted by facecat View Post
... get the duration of a file and move it into a specific folder ...
Code:
// Move media files based on duration
// Trigger: "A Download Stopped"

if (link.isFinished()) {
    var file = getPath(link.getDownloadPath());
    var fileTypes = ["mkv", "mp4", "avi", "mp3", "m4a", "ogg", "opus"]; // <- Set media file types

    if (fileTypes.indexOf(file.getExtension()) > -1) {
        var cutoff = 60; // <- Set cutoff duration (in minutes)
        var big = "c:/downloads/big"; // <- Set folder
        var small = "c:/downloads/small"; // <- Set folder
        var ffprobe = "c:/apps/ffmpeg/bin/ffprobe.exe"; // <- Set path to ffprobe (Can also use the binary found in 'JD\tools' folder)
        var duration = JSON.parse(callSync(ffprobe, "-v", "-8", "-show_entries", "format", "-of", "json", file)).format.duration;

        if (duration < cutoff * 60) {
            file.moveTo(small);
        } else {
            file.moveTo(big)
        }
    }
}
Reply With Quote
  #160  
Old 19.08.2017, 21:34
facecat
Guest
 
Posts: n/a
Default

thanks mgpai
it works

Last edited by facecat; 20.08.2017 at 01:17.
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 19:03.
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.