JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #801  
Old 25.06.2019, 10:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

Quote:
Originally Posted by the Dark View Post
Is there a way to put it into download directly not in linkcrawler/-list ?
In Crawljob for Folderwatch you have to enable AutoConfirm AND AutoStart flags


Quote:
Originally Posted by the Dark View Post
Will this work even if jDownloader crashes or is it better to set every 15th and 30th? possible?
Interval of 5 Days -> JDownloader starts and waits 5 days. Your JDownloader should not crash at all!
If your setup somehow let JDownloader crash, then maybe instead of 5 days interval, better on fixed days like
1,5,10,15,20,25..of the month.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #802  
Old 25.06.2019, 14:03
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by the Dark View Post
I want to delete all downloaded files every 5 minutes to keep the hard drive clean (hard drive space is limited)
This would mean a file created at 04m59s will be deleted at 05m00s, almost within less than a second after it was created. If you provide more information, we might be able to recommend alternative solution. Please find me in JD Chat.

Code:
jdownloader.org/knowledge/chat

Quote:
Originally Posted by the Dark View Post
Is there a way to put it into download directly not in linkcrawler/-list ?
For crawljobs, you can define the parameters in the job file itself, as suggested by Jiaz in the previous post. For dlc files, you have to either set it in the packagizer rule (suggested in one of my previous posts) or enable it globally in the linkgrabber bottom toolbar.

Quote:
Originally Posted by the Dark View Post
Will this work even if jDownloader crashes or is it better to set every 15th and 30th? possible?
Code:
// Enable Folder Watch on user specified dates
// Trigger : Interval
// Set Interval to 86400000

var dates = [7, 14, 21, 28]; // <- Set dates
var folderWatch = "org.jdownloader.extensions.folderwatchV2.FolderWatchExtension";
var currentStatus = callAPI("extensions", "isEnabled", folderWatch);
var desiredStatus = dates.indexOf(new Date().getDate()) > -1;

if (currentStatus != desiredStatus) callAPI("extensions", "setEnabled", folderWatch, desiredStatus);
Reply With Quote
  #803  
Old 25.06.2019, 14:25
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

Quote:
Originally Posted by mgpai View Post
This would mean a file created at 04m59s will be deleted at 05m00s, almost within less than a second after it was created.
You can run the check all 5 mins and use the lastmodified timestamp of the file for delete decision
__________________
JD-Dev & Server-Admin
Reply With Quote
  #804  
Old 25.06.2019, 14:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by Jiaz View Post
You can run the check all 5 mins and use the lastmodified timestamp of the file for delete decision
Quote:
Originally Posted by the Dark View Post
I want to delete all downloaded files every 5 minutes to keep the hard drive clean (hard drive space is limited)
I just want to confirm if this is literally what the user wants and also inform how such a script would work.
Reply With Quote
  #805  
Old 25.06.2019, 23:29
the Dark
Guest
 
Posts: n/a
Default

I just want to prevent the hard drive is getting filled up.
Maybe I explain what I want to do with the script:
It should run in backraund as a cronjob. filehoster store files for 30 days without diwnload. so I want to download these files to renew the timestamp on the host side. hope you understand. In the watchfolder I want to put every *dlc for each movie.
ex.: Im downloading 5GB/minutes after 5 minutes I have 25GB on my harddrive that are „wasted“ so I want do delete these 25GB of *.rar file vut not *.rar.part
1Tb needs to be downloaded in total so I only have a harddrive with 200GB.
Reply With Quote
  #806  
Old 26.06.2019, 09:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by the Dark View Post
/as/example/deletefilesfolder //<--- path to there only watchfolder files get downloaded (manually downloaded files should stay in another path)

if the files got downloaded I want to delete them after about 5 minutes to keep the drive clean (needs to be a seperate folder)
Delete files at specified interval:
Code:
// Delete downloaded files from user-specified folder, at user-specified interval.
// Trigger : Interval (300000)

var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive

getAllDownloadLinks().forEach(function(link) {
    if (!link.isFinished()) return;
    var file = getPath(link.getDownloadPath());
    if (!file.exists()) return;
    var downloadFolder = link.getPackage().getDownloadFolder();
    if (downloadFolder == myFolder) file.delete();
})

Delete files immediately after downloading (Recommended):
Code:
// Delete downloaded files from user-specified folder, immediately after it's been downloaded.
// Trigger : A Download Stopped

var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive

if (link.isFinished()) {
    var downloadFolder = link.getPackage().getDownloadFolder();
    if (downloadFolder == myFolder) {
        var file = getPath(link.getDownloadPath());
        file.delete();
    }
}
Reply With Quote
  #807  
Old 26.06.2019, 10:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@mgpai: maybe instead of delete , first move to sort of trash folder and then wait another loop to *empty* the trash
__________________
JD-Dev & Server-Admin
Reply With Quote
  #808  
Old 26.06.2019, 11:30
thecoder2012's Avatar
thecoder2012 thecoder2012 is offline
Verified Account
 
Join Date: Feb 2013
Location: Internet
Posts: 1,324
Default

Quote:
Originally Posted by Jiaz View Post
We don't want to provide access to the internal url as this can be abused or the internal url is something purely internal but I've added getPluginURL method with next core update
Sure and getPluginURL works great. Thanks!

Example "Downloads":
Code:
// Export download URLs
// Trigger : "DownloadList Contextmenu Button Pressed"
setAdvancedAlert(true);
//disablePermissionChecks();

if (name == "Export URLs") {
    if (dlSelection.getDownloadLinks().length != 0) {
        var links = dlSelection.getDownloadLinks();
        var urls = [];

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var downloadURL;
            if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getPluginURL())) {
                downloadURL = link.getPluginURL() + "#" + fileName;
            } else {
                downloadURL = link.getContentURL() + "#" + fileName;
            }
            urls.push(downloadURL);
        }
        alert(urls.join("\r\n") + "\n");
    }
}

Example "LinkGrabber":
Code:
// Export URLs (LinkGrabber)
// Trigger : "LinkGrabber Contextmenu Button Pressed"
setAdvancedAlert(true);
//disablePermissionChecks();

if (name == "Export URLs") {
    if (lgSelection.getLinks().length != 0) {
        var links = lgSelection.getLinks();
        var urls = [];

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var lgURL;
            if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(link.getUrl())) {
                lgURL = link.getUrl() + "#" + fileName;
            } else {
                lgURL = link.getContentURL() + "#" + fileName;
            }
            urls.push(lgURL);
        }
        alert(urls.join("\r\n") + "\n");
    }
}

Example "See new links" (in the comment field):
Code:
// See new links (in the comment field)
// Trigger : "A new link has been added"
//setAdvancedAlert(true);
//disablePermissionChecks();

var myPLink = link;
if (/(http(s?)):\/\/|(ftp(s?)):\/\//gi.test(myPLink.getURL())) {
    myPLink.setComment(myPLink.getURL());
} else {
    myPLink.setComment(myPLink.getProperty("URL_CONTENT"));
}

Example "Get Archive Password (Downloads)" (Contextmenu):
Code:
// Get Archive Password (Downloads)
// Trigger: "DownloadList Contextmenu Button Pressed"
setAdvancedAlert(true);

if (name == "Get Archive Password") {
    if (dlSelection.getDownloadLinks().length != 0) {
        var links = dlSelection.getDownloadLinks();
        var data = "";

        for (i = 0; i < links.length; i++) {
            var link = links[i];
            var fileName = link.getName();
            var downloadURL;
            if (/(http(s?)):\/\//gi.test(link.getPluginURL())) {
                downloadURL = link.getPluginURL() + "#" + fileName;
            } else {
                downloadURL = link.getContentURL() + "#" + fileName;
            }
            var myArchive = link.getArchive();
            var passwords = "";
            var finalPassword = "";
            if (link.getArchive()) {
                if (myArchive.getInfo().hasOwnProperty("passwords")) {
                    passwords = myArchive.getInfo().passwords;
                }
                if (myArchive.getInfo().hasOwnProperty("finalPassword")) {
                    finalPassword = myArchive.getInfo().finalPassword;
                }
            }
            if (finalPassword == null) {
                finalPassword = ""
            }
            if (passwords == null) {
                passwords = ""
            }
            data += downloadURL + "\n" + "Passwords:" + passwords + "\nFinalPassword: " + finalPassword + "\n\n";
        }
        alert(data);
    }
}

Example "Speedtest":
Code:
// Add downloadlinks as speedtest
// Trigger: Main Menu Button Pressed (Schaltfläche Hauptmenü betätigt)
// Triggername: Speedtest

if (name == "Speedtest") {
    var dlURL = [];

    dlURL.push("http" + "://cdn8.appwork.org/speed.zip");
    // speed.hetzner.de
    dlURL.push("https" + "://speed.hetzner.de/100MB.bin");
    dlURL.push("https" + "://speed.hetzner.de/1GB.bin");
    dlURL.push("https" + "://speed.hetzner.de/10GB.bin");
    // ovh.net/files/
    dlURL.push("http" + "://www.ovh.net/files/1Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/10Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/100Mb.dat");
    dlURL.push("http" + "://www.ovh.net/files/1Gb.dat");
    dlURL.push("http" + "://www.ovh.net/files/10Gb.dat");
    // speedtest.tele2.net
    dlURL.push("http" + "://speedtest.tele2.net/1MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/10MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/100MB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/1GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/10GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/100GB.zip");
    dlURL.push("http" + "://speedtest.tele2.net/1000GB.zip");
    // speedtest.serverius.net
    dlURL.push("http" + "://speedtest.serverius.net/files/10mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/100mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/1000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/2000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/5000mb.bin");
    dlURL.push("http" + "://speedtest.serverius.net/files/10000mb.bin");
    // mirror.nl.leaseweb.net/speedtest
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/100mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/1000mb.bin");
    dlURL.push("http" + "://mirror.nl.leaseweb.net/speedtest/10000mb.bin");
    // mirror2.netcologne.de
    dlURL.push("http" + "://mirror2.netcologne.de/10g.bin");
    dlURL.push("http" + "://mirror2.netcologne.de/1gb.bin");
    // speedtest.belwue.net/http-dl.html
    dlURL.push("http" + "://speedtest.belwue.net/random-100M");
    dlURL.push("http" + "://speedtest.belwue.net/random-1G");
    dlURL.push("http" + "://speedtest.belwue.net/10G");
    dlURL.push("http" + "://speedtest.belwue.net/100G");
    dlURL.push("http" + "://speedtest.belwue.net/1000G");
    // www.speedtestx.de (captcha required)
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_10mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_256mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_500mb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_1gb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_5gb.test");
    //dlURL.push("https" + "://www.speedtestx.de/testfiles/data_100mb_compressable.test");


    callAPI("linkgrabberv2", "addLinks", {
        "deepDecrypt": false,
        "packageName": "Speedtest",
        "links": dlURL.join("\r\n")
    });

}
__________________
Join 9kw.eu Captcha Service now and let your JD continue downloads while you sleep.

Last edited by thecoder2012; 22.07.2019 at 10:07.
Reply With Quote
  #809  
Old 27.06.2019, 01:22
dankmemer dankmemer is offline
Registered / Inactive
 
Join Date: Jun 2019
Posts: 8
Default

I tried searching but I don't think my specific case was discussed here!

I am downloading files that sometimes have the same file name, however they are not the same file. Sometimes they are, but sometimes they're not. I think this was a website that did poor CDN practices early on, but later changed their file name system when they grew.

Anyways, what the script would have to check for is both the file name AND the size of the file. If both are the same, then the file is a duplicate, otherwise download the file by renaming the new file.

The files are all within folder, example:
Folder > Folder1 > 67575675.jpg
Folder > Folder1 > 67575675.jpg (duplicate)


There are other folders, so in that example imagine Folder2, etc. BUT this script only needs to check the folder it's saving within.
Reply With Quote
  #810  
Old 27.06.2019, 04:15
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,674
Default

@dankmemer
core feature already does that, so a script wont be needed.
settings > advanced settings > GeneralSettings.mirrordetectiondecision == FILENAME_FILESIZE
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #811  
Old 28.06.2019, 16:35
the Dark
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
Delete files at specified interval:
Code:
// Delete downloaded files from user-specified folder, at user-specified interval.
// Trigger : Interval (300000)

var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive

getAllDownloadLinks().forEach(function(link) {
    if (!link.isFinished()) return;
    var file = getPath(link.getDownloadPath());
    if (!file.exists()) return;
    var downloadFolder = link.getPackage().getDownloadFolder();
    if (downloadFolder == myFolder) file.delete();
})

Delete files immediately after downloading (Recommended):
Code:
// Delete downloaded files from user-specified folder, immediately after it's been downloaded.
// Trigger : A Download Stopped

var myFolder = "/as/example/deletefilesfolder"; // <- case-sensitive

if (link.isFinished()) {
    var downloadFolder = link.getPackage().getDownloadFolder();
    if (downloadFolder == myFolder) {
        var file = getPath(link.getDownloadPath());
        file.delete();
    }
}
Sorry this is the script now but I can not make it work

Code:
// Enable Folder Watch on user specified dates
// Trigger : Interval

var dates = [1, 16]; // <- Set dates
var watchfolder = "/watchfolder/dir";
var myFolder = "/downloadfolder/delete/after/download"; // <- case-sensitive
var currentStatus = callAPI("extensions", "isEnabled", folderWatch);
var desiredStatus = dates.indexOf(new Date().getDate()) > -1;

if (currentStatus != desiredStatus) callAPI("extensions", "setEnabled", folderWatch, desiredStatus);

if sourceurl(s) contains : file:/*.dlc;
then set... Download Directory: /downloadfolder/delete/after/download;

// Delete downloaded files from user-specified folder, immediately after it's been downloaded.
// Trigger : A Download Stopped

if (link.isFinished()) {
    var downloadFolder = link.getPackage().getDownloadFolder();
    if (downloadFolder == myFolder) {
        var file = getPath(link.getDownloadPath());
        file.delete();
    }
}
Is there also an option to not move the laoded *.dlc into a subfolder "added" ?

Last edited by the Dark; 28.06.2019 at 16:39.
Reply With Quote
  #812  
Old 28.06.2019, 16:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

Quote:
Originally Posted by the Dark View Post
Is there also an option to not move the laoded *.dlc into a subfolder "added" ?
I could add support to *rename* the file. Somehow JDownloader needs to know if to parse the file again or it is already been processed before
__________________
JD-Dev & Server-Admin
Reply With Quote
  #813  
Old 28.06.2019, 17:30
manforce
Guest
 
Posts: n/a
Default

Good afternoon to everybody,
I've a question. It's my first time here, sorry if I re-write something already wrote, please tell me in case, no worries!
My idea is to make a script do download everyday a file and then send it by mail.
Would it be possible?
Thanks so much in advance...
Reply With Quote
  #814  
Old 28.06.2019, 18:26
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

Quote:
Originally Posted by manforce View Post
My idea is to make a script do download everyday a file and then send it by mail.
Download the same file? different file? send the file or link by mail. I'm asking because larger files are often not supported by mail providers
__________________
JD-Dev & Server-Admin
Reply With Quote
  #815  
Old 28.06.2019, 18:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by the Dark View Post
Sorry this is the script now but I can not make it work
How can it work? They are 2 different scripts with 2 different triggers. Also the instructions to create the packagizer rule are not part of the script. They are just instructions to create a packagizer rule.
  • Add the scripts separately, and select the triggers as per instructions in the script.
  • Create the packagizer rule in 'Settings > Packagizer' based on the instruction provided in my earlier post.
Reply With Quote
  #816  
Old 29.06.2019, 08:53
the Dark
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
How can it work? They are 2 different scripts with 2 different triggers. Also the instructions to create the packagizer rule are not part of the script. They are just instructions to create a packagizer rule.
  • Add the scripts separately, and select the triggers as per instructions in the script.
  • Create the packagizer rule in 'Settings > Packagizer' based on the instruction provided in my earlier post.
OK thanks!!
I got it now - half way.
Everytime I start a download manually (other path than my "delete folder") I get an error message because no files ar in me "delete"folder



Also the *.dlc file gets moved into "added" subfolder - is there a possibility to move if all downloads are finished? --> move als *dlc from subfolder "added" to subfolder "watch"?
Reply With Quote
  #817  
Old 01.07.2019, 11:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@mgpai and the_Dark:
link.getPackage() may return null when the link no longer belongs to a package. scripts needs to check for null
__________________
JD-Dev & Server-Admin
Reply With Quote
  #818  
Old 01.07.2019, 12:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by Jiaz View Post
@mgpai and the_Dark:
link.getPackage() may return null when the link no longer belongs to a package. scripts needs to check for null
Quote:
Originally Posted by the Dark View Post
Everytime I start a download manually ... I get an error message ...
@jiaz: How can it be null on download start? Also, none of the scripts provided to the user have a "A Download Started" Trigger. I have not been able to reproduce the it.

It is possible for one of the scripts (delete after download) to throw that error, if the user has enabled "remove finished downloads" in General Settings. In which case, the user will need to disable it for the script to work.

I will check again when I get user feedback.

@the Dark: Make sure you have selected the correct trigger.

Quote:
Originally Posted by the Dark View Post
Also the *.dlc file gets moved into "added" subfolder - is there a possibility to move if all downloads are finished? --> move als *dlc from subfolder "added" to subfolder "watch"?
If you are enabling the folderwatch only on specific dates, you would not need to move the DLCs to a subfolder. You can just keep them in the 'added' folder and move them back to the watchfolder, whenever you wish to download them again. Under these circumstances, you will also not need a script to enable/disable folderwatch.
Reply With Quote
  #819  
Old 01.07.2019, 12:15
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@mgpai: my guess is that there is wrong script/wrong event. screenshot shows that "getDownloadFolder of null" and that happens when link.getPackage is null. Yes, remove finished downloads must be disabled else the link will be removed from list before any script can process them.
__________________
JD-Dev & Server-Admin
Reply With Quote
  #820  
Old 01.07.2019, 17:24
manforce
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
Download the same file? different file? send the file or link by mail. I'm asking because larger files are often not supported by mail providers
Hi!
Thank you first of all..
there're different file, like newspapers, about 25MB each.
Would be it possible?
Thanks again:)
Reply With Quote
  #821  
Old 01.07.2019, 17:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@manforce: you would need a 3rd party tool that can send mails and call it via eventscripter and specify the file to send. eventscripter then waits for download to finish and then call the 3rd party tool to send the mail
__________________
JD-Dev & Server-Admin
Reply With Quote
  #822  
Old 02.07.2019, 16:00
manforce
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
@manforce: you would need a 3rd party tool that can send mails and call it via eventscripter and specify the file to send. eventscripter then waits for download to finish and then call the 3rd party tool to send the mail
Ok, thanks! Which one do you suggest to use for that? Thanks again!
Reply With Quote
  #823  
Old 02.07.2019, 16:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

what os are you using? I would ask google/search engine of your choice for easy to use commandline tool to send mails
__________________
JD-Dev & Server-Admin
Reply With Quote
  #824  
Old 02.07.2019, 16:13
Doughee
Guest
 
Posts: n/a
Default

Hi, I'd like a way to output all filenames in a given package to either the clipboard or a text file. I've studied the thread, and it shows ways to export download URLs only (I believe) and disable files with duplicate filenames relative to a text file/actual disk files, and I'll probably experiment with those in the future.

In my case though, copying the same source URL again after some time (not always) creates a whole new package with all the same files (they don't show up as dupes), plus all the changes I'm oblivious about, and I've already done that. I'm wasting so much time right now just trying to find out which files are new, renamed, or even removed out of hundreds and hundreds in there, I believe my best bet right now is copying the 2 different lists (original + new) to Notepad++ and handle it from there.

I'm still experimenting with the Packagizer, Event Filter and Advanced Settings, but right now they aren't gonna help, so a file list is the only thing that's gonna untangle this web.

Thanks for any help!

Last edited by Doughee; 02.07.2019 at 16:19.
Reply With Quote
  #825  
Old 02.07.2019, 16:34
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by Doughee View Post
... output all filenames in a given package to ... the clipboard ...
Customize Context Menu > Add "Copy Information" buttton > Configure it using 'Edit menu node' panel on the right hand side of the menu editor.

For e.g. To copy just the filenames of the selected links/packages to clipboard, set "Pattern for the links" to "{name}".
Reply With Quote
  #826  
Old 02.07.2019, 16:53
Doughee
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by mgpai View Post
Customize Context Menu > Add "Copy Information" buttton > Configure it using 'Edit menu node' panel on the right hand side of the menu editor.

For e.g. To copy just the filenames of the selected links/packages to clipboard, set "Pattern for the links" to "{name}".
Thanks, it worked! Shows how much I don't know about JD2 posting in this thread.
Reply With Quote
  #827  
Old 02.07.2019, 17:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@Doughee: shows that JDownloader offers sooo much more *under the hood*
__________________
JD-Dev & Server-Admin
Reply With Quote
  #828  
Old 02.07.2019, 17:52
the Dark
Guest
 
Posts: n/a
Default

Hi guys!

Quote:
Originally Posted by mgpai View Post
@the Dark: Make sure you have selected the correct trigger.
The checkbox gets removed automatic if I click "OK" on error message.



Quote:
Originally Posted by mgpai View Post
If you are enabling the folderwatch only on specific dates, you would not need to move the DLCs to a subfolder. You can just keep them in the 'added' folder and move them back to the watchfolder, whenever you wish to download them again. Under these circumstances, you will also not need a script to enable/disable folderwatch.
I want to download the same file every 15 days so the dont get deleted - I want the script to do all the magic So moving the files would be awesome...

Example: 50 *.dlc files get loaded into LinkGrabber total download size ~4TB

I need to correct the error message: It get shown everytime! The files do not get deleted so the fill up my hard drive
Reply With Quote
  #829  
Old 02.07.2019, 18:20
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

Quote:
Originally Posted by the Dark View Post
The checkbox gets removed automatic if I click "OK" on error message.

broken scripts are auto deactivated
__________________
JD-Dev & Server-Admin
Reply With Quote
  #830  
Old 02.07.2019, 18:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

can you show the script for *download stopped* event?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #831  
Old 02.07.2019, 18:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by the Dark View Post
The checkbox gets removed automatic if I click "OK" on error message
You may get that error if you have enabled "Remove finished downloads" in "Settings > General". Set it to "never" or "at startup".

If you still get errors, contact me in JD Chat.
Reply With Quote
  #832  
Old 03.07.2019, 10:50
manforce
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by Jiaz View Post
what os are you using? I would ask google/search engine of your choice for easy to use commandline tool to send mails
Win7 or 10.. ok, I try to search, then maybe I'd need help just to write the script correctly..:)
Reply With Quote
  #833  
Old 04.07.2019, 14:38
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@manforce: sure, once you've found a tool, we will try to help with the script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #834  
Old 04.07.2019, 20:02
dnav5
Guest
 
Posts: n/a
Default Convert AAC/M4A/OGG files to MP3 with Tempo Speed

Hi everyone,

I have been using Convert AAC/M4A/OGG files to MP3 script by mgpai for a while, and it has been great. I mainly use it to download newscast and listen them while in the gym/driving.
Is it possible to speed up the audio by adding ATEMPO settings?

I spent some time trying to add it, but can't get it to work. Can someone help?


// Convert aac/m4a/ogg files to mp3.
// Trigger required: "A Download Stopped".
// Requires ffmpeg/ffprobe. Uses JD ffmpeg/ffprobe settings if available.
// Overwrites destination file (mp3) if it already exists.

if (link.isFinished()) {
var fileName = link.name.replace(/(.+)(\..+$)/, "$1");
var fileType = link.name.replace(/(.+)(\..+$)/, "$2");
var sourceFile = link.getDownloadPath();
var audioFile = /\.(aac|m4a|ogg)$/.test(sourceFile);

if (audioFile) {
var downloadFolder = package.getDownloadFolder();
var destFile = downloadFolder + "/" + fileName + ".mp3";
var ffmpeg = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypath");
var ffprobe = callAPI("config", "get", "org.jdownloader.controlling.ffmpeg.FFmpegSetup", null, "binarypathprobe");
var data = JSON.parse(callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile));
var streamsBitrate = data.streams[0].bit_rate ? data.streams[0].bit_rate : 0;
var formatBitrate = data.format.bit_rate ? data.format.bit_rate : 0;
var bitrate = Math.max(streamsBitrate, formatBitrate) / 1000;
var deleteSourceFile = true; // Set this to true to delete source file after conversion.

if (bitrate > 0) {
callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", atempo="1.5", destFile);
if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false);
}
}
}
Reply With Quote
  #835  
Old 04.07.2019, 20:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

try
Quote:
callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", "-filter:a","atempo=1.5", destFile);
__________________
JD-Dev & Server-Admin
Reply With Quote
  #836  
Old 06.07.2019, 12:23
SMS SMS is offline
JD Fan
 
Join Date: Jun 2019
Posts: 71
Default

Low-priority question:
How to do the following?
If download of zip file is about to start but directory with the same name already exists, don't download (for example disable) that zip file.
Reply With Quote
  #837  
Old 06.07.2019, 13:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by SMS View Post
If download of zip file is about to start but directory with the same name already exists, don't download (for example disable) that zip file.
Which directory should be compared? Download directory or extraction directory? Please give a working example.
Reply With Quote
  #838  
Old 06.07.2019, 14:56
dankmemer dankmemer is offline
Registered / Inactive
 
Join Date: Jun 2019
Posts: 8
Default

Quote:
Originally Posted by raztoki View Post
@dankmemer
core feature already does that, so a script wont be needed.
settings > advanced settings > GeneralSettings.mirrordetectiondecision == FILENAME_FILESIZE
Dumb question, but how do I utilize this feature in my scenario? Would I disable "download duplicates" while this setting is on? It's still downloading duplicates despite this on..
Reply With Quote
  #839  
Old 06.07.2019, 15:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 81,218
Default

@dankmemer: this option tells JDownloader to compare file sizes as well. so different filesize -> different file
__________________
JD-Dev & Server-Admin
Reply With Quote
  #840  
Old 06.07.2019, 16:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,613
Default

Quote:
Originally Posted by dankmemer View Post
I tried searching but I don't think my specific case was discussed here!

I am downloading files that sometimes have the same file name, however they are not the same file. Sometimes they are, but sometimes they're not. I think this was a website that did poor CDN practices early on, but later changed their file name system when they grew.

Anyways, what the script would have to check for is both the file name AND the size of the file. If both are the same, then the file is a duplicate, otherwise download the file by renaming the new file.

The files are all within folder, example:
Folder > Folder1 > 67575675.jpg
Folder > Folder1 > 67575675.jpg (duplicate)


There are other folders, so in that example imagine Folder2, etc. BUT this script only needs to check the folder it's saving within.
Quote:
Originally Posted by Jiaz View Post
@dankmemer: this option tells JDownloader to compare file sizes as well. so different filesize -> different file
Looks like the user's requirement is similar to the one in this thread.
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 21:53.
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.