JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #181  
Old 08.09.2017, 19:29
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

@or3n: you know the script only works for packages, not individual links?
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 08.09.2017 at 19:32.
Reply With Quote
  #182  
Old 08.09.2017, 20:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 451
Default

Quote:
Originally Posted by 0r3n View Post
... The script for saving comments doesn't work for couple of weeks now ...
The script is working fine. For which site do you use the script? Does that plugin still write the description to the comments field?
Reply With Quote
  #183  
Old 10.09.2017, 08:58
0r3n 0r3n is offline
Vacuum Cleaner
 
Join Date: Oct 2016
Posts: 17
Default

Quote:
Originally Posted by Jiaz View Post
@or3n: you know the script only works for packages, not individual links?
Hi Jiaz, yes.


Quote:
Originally Posted by mgpai View Post
The script is working fine. For which site do you use the script? Does that plugin still write the description to the comments field?
I'm trying to use it for Instagram, I noticed that comments doesn't appear in JDownloader as before but thought maybe it's internal issue and that they are there anyway.
so if the comments doesn't appear in JDownloader "comments" column it's a plugin issue?
Reply With Quote
  #184  
Old 11.09.2017, 19:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

@0r3n: wait for plugin update. comment handling was broken because of instagram site changes
__________________
JD-Dev & Server-Admin
Reply With Quote
  #185  
Old 12.09.2017, 20:16
facecat facecat is offline
Baby Loader
 
Join Date: Aug 2017
Posts: 8
Default

hi
sorry to disturb you for that but the mgpai script for sorting files by duration (https://board.jdownloader.org/showpo...&postcount=159) cant be started for every "files" but only "bundle" we dont have "file finished" trigger in "event scripter" is it possible to fix that by something more inside the script or a new trigger

ps : if i select "interval" i have an error (https://i.imgur.com/jzou6a2.png)
thx in advance
Reply With Quote
  #186  
Old 12.09.2017, 20:28
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

You have to use the trigger "Download Stopped" as commented in the script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #187  
Old 12.09.2017, 20:50
facecat facecat is offline
Baby Loader
 
Join Date: Aug 2017
Posts: 8
Default

ho my bad sry thank you im gonna try this
Reply With Quote
  #188  
Old 14.09.2017, 00:47
0r3n 0r3n is offline
Vacuum Cleaner
 
Join Date: Oct 2016
Posts: 17
Default

Quote:
Originally Posted by Jiaz View Post
@0r3n: wait for plugin update. comment handling was broken because of instagram site changes
Thanks Jiaz, after the update everything is working
Reply With Quote
  #189  
Old 14.09.2017, 10:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

@03rn: you're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #190  
Old 17.09.2017, 10:53
Informativ Informativ is offline
Giga Loader
 
Join Date: Nov 2016
Posts: 96
Default

good morning,
will it work for me? (deleted files in download folder)

Code:
// Delete from download folder, any file/folder which contains user specified keywords
// Trigger required: "A Download Stopped"

package.getDownloadFolder().forEach(function(file) {
    var re = /.*(ajax-loader|url).*/;
    var junkFile = re.test(file.getName());
    var junkFolder = re.test(file.getParent().getName());

    if (junkFile) file.delete();
    if (junkFolder) file.getParent().deleteRecursive();
});
other question:

I want the download to be finished, check if there is a pdf file, if so, this is started
F:\Downloads\files\PDFConverter.exe "%DEPACKFOLDER%" "%DEPACKFOLDER%" -c PNG -p 1 -pd 4x5
"%DEPACKFOLDER%" = DownloadFolder

is that possible?

Last edited by Informativ; 17.09.2017 at 11:00. Reason: edit
Reply With Quote
  #191  
Old 18.09.2017, 07:41
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 451
Default

Quote:
Originally Posted by Informativ View Post
... will it work for me? (deleted files in download folder) ...
The script will not work in its present form. You have to to get the download links for the package and then query and delete them.

If you always want to delete such files, it is better to use linkfilter and prevent the links from being added to JD in the first place, rather than downloading, and deleting them later using event scripter.

Quote:
Originally Posted by Informativ View Post
I want the download to be finished, check if there is a pdf file, if so, this is started ...
Code:
// Run external program if package contains 'pdf' file
// Trigger: "Package finished"

var pdf = package.getDownloadLinks().some(function(link) {
    return getPath(link.getDownloadPath()).getExtension() == "pdf";
});

if (pdf) {
    var downloadFolder = package.getDownloadFolder();
    var converter = "f:/downloads/files/pdfConverter.exe";
    callAsync(function() {}, converter, downloadFolder, downloadFolder, "-c", "PNG", "-p", "1", "-pd", "4x5");
}
Reply With Quote
  #192  
Old 18.09.2017, 13:40
Informativ Informativ is offline
Giga Loader
 
Join Date: Nov 2016
Posts: 96
Default

hi mgpai,
if no pdf available, that comes
Spoiler:

Quote:
The script will not work in its present form. You have to to get the download links for the package and then query and delete them.

If you always want to delete such files, it is better to use linkfilter and prevent the links from being added to JD in the first place, rather than downloading, and deleting them later using event scripter.
that a option, but over word is better
Reply With Quote
  #193  
Old 18.09.2017, 13:49
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

looks like copy/paste error or invalid script. error is about syntax error in script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #194  
Old 02.10.2017, 09:06
Informativ Informativ is offline
Giga Loader
 
Join Date: Nov 2016
Posts: 96
Default

hi,
is it possible to stop this part and then restart it?
Spoiler:
Reply With Quote
  #195  
Old 07.10.2017, 23:23
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default

Hi.
Textbox contents in messagebox is invisible height.
How change height?

Code:
alert("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");

Last edited by pachi; 08.10.2017 at 05:47.
Reply With Quote
  #196  
Old 08.10.2017, 10:26
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 451
Default

Quote:
Originally Posted by pachi View Post
Textbox contents in messagebox is invisible height. How change height?
Know issue. Workaround: Add "\r\n" at the end of the object/string.

Code:
alert("myString"+"\r\n");
Reply With Quote
  #197  
Old 08.10.2017, 10:56
pachi pachi is offline
Baby Loader
 
Join Date: Oct 2017
Location: Japan
Posts: 6
Default

Quote:
Originally Posted by mgpai View Post
Know issue. Workaround: Add "\r\n" at the end of the object/string.

Code:
alert("myString"+"\r\n");
Thank you!
Reply With Quote
  #198  
Old 09.10.2017, 11:11
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 60,451
Default

__________________
JD-Dev & Server-Admin
Reply With Quote
  #199  
Old 15.10.2017, 00:52
Tyler Tyler is offline
JD Legend
 
Join Date: Jul 2010
Posts: 582
Default

Quote:
Originally Posted by fred_gaou View Post
Hi,

Here is a script to help you to auto clean/format filename during the link grabbing process. This is done automatically in background for each added link.

You can set some options at the top of the script.

This is useful in any case as soon as you notice a recurring pattern in your filenames that you'll want to get rid of or format.

if you set custom filename for video files such as:
Code:
[*CHANNEL*] (*PLAYLIST_NAME* *PLAYLIST_POSITION[00]*) *DATE[YY.MM.dd]* - *VIDEO_NAME*.*EXT*
it will be perfect for playlist but not for one video file only because then you will end with a filename with empty brackets:
Code:
[Any Youtuber Channel] ( ) 17.03.11 - Video Title
This script will take care of it removing those bracket:
Code:
[Any Youtuber Channel] 17.03.11 - Video Title
Code:
// LINK NAME CLEANER (auto)
// Trigger required: Packagizer Hook

/* *************************************************************************
Set the characters that will be removed from both ends of the filename.
Be sure to double escape special chars such as "\\s" instead of "\s".
****************************************************************************/

var leadAndTrailTrimChars = "\\s-_";

/* *************************************************************************
Set the characters that will be replaced with whitespace.
Be sure to double escape special chars such as "\\s" instead of "\s".
****************************************************************************/

var charToSpace = "_";

/* *************************************************************************
Set the words or phrases to remove. Words/phrases must be separated with | such as
"word one|word two|word three"
Be sure to double escape special chars such as "\\s" instead of "\s".
****************************************************************************/

var wordsToRemove = "with subtitles";

/***************************************************************************/

if (linkcheckDone) {


    /* =========================== INITIALIZE ============================ */

    var myPackagizerLink = link;
    var fileName = myPackagizerLink.getName();
    var re, ext;

    // Remove the extension from the end and save it for later.
    // And make it lower case at the same time.
    ext = fileName.slice((fileName.lastIndexOf(".") - 1 >>> 0) + 2);
    if (ext !== "") {
        ext = "." + ext.toLowerCase();
    }

    // If extension exists, then we will work with the filename without extension
    fileName = fileName.substr(0, (fileName.length - ext.length));

    /* ========================= REGEX PATTERNS ========================== */

    // Remove these words/phrase : wordsToRemove
    re = new RegExp("\\b(?:" + wordsToRemove + ")\\b", "gi");
    fileName = fileName.replace(re, "");

    // Replace these characters with whitespace : charToSpace
    re = new RegExp("[" + charToSpace + "]", "gi");
    fileName = fileName.replace(re, " ");

    // Delete empty bracket content. "( )", "[ ]" or "{ }" will be removed from filename.    
    re = new RegExp("(\\(\\s+?\\))|(\\[\\s+?\\])|({\\s+?})", "gi");
    fileName = fileName.replace(re, "");

    /* ====== ALWAYS APPLY NEXT REPLACEMENTS AT THE END OF PROCESS ======= */

    // Remove unwanted characters from both ends of the filename
    re = new RegExp("^[" + leadAndTrailTrimChars + "]*(.+?)[" + leadAndTrailTrimChars + "]*$", "gi");
    fileName = fileName.replace(re, "$1");

    // Replace multiple spaces with only one
    re = new RegExp("\\s\\s+", "gi");    
    fileName = fileName.replace(re, " ");

    // Removes whitespace from both ends of the filename (just to be sure)
    fileName = fileName.trim();

    /* ====== APPLY NEW FILE NAME ======= */
    myPackagizerLink.setName(fileName + ext);
}
can you fix this?

says ReferenceError: "linkcheckDone" is not defined. (#28)
Reply With Quote
  #200  
Old 15.10.2017, 03:03
fred_gaou's Avatar
fred_gaou fred_gaou is offline
DSL User
 
Join Date: Mar 2016
Location: France
Posts: 37
Default

Quote:
Originally Posted by Tyler View Post
can you fix this?

says ReferenceError: "linkcheckDone" is not defined. (#28)
It works here on last JD 2.0 #617. So nothing to fix.
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:20.
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.