JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1641  
Old 08.01.2021, 19:40
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,349
Default

@SMS: please use board search how to use packagizer to auto rename links via meta information within URL, eg https://board.jdownloader.org/showpo...18&postcount=2
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1642  
Old 15.01.2021, 13:24
SMS SMS is offline
DSL User
 
Join Date: Jun 2019
Posts: 38
Default

Quote:
Originally Posted by Jiaz View Post
@SMS: please use board search how to use packagizer to auto rename links via meta information within URL, eg **External links are only visible to Support Staff**...
There seems to be a bug, I just described it here: https://board.jdownloader.org/showpo...5&postcount=40
Reply With Quote
  #1643  
Old 15.01.2021, 13:39
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 69,349
Default

@SMS: no bug, I've answered in the thread
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1644  
Old 15.01.2021, 17:23
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

YT playlist workaround script:

Code:
gist.github.com/mgpai/b2c21be86fbdf2186eca34af16cfb95d
Reply With Quote
  #1645  
Old 16.01.2021, 01:29
SMS SMS is offline
DSL User
 
Join Date: Jun 2019
Posts: 38
Default

What's a graceful way to check whether a string is contained in another string? Both strings are variables, so it can't be a hardcoded regex pattern.

Usually JavaScript offers string1.includes(string2), or the older string1.contains(string2), but neither work.

In general, what JavaScript version does the Event Scripter use?

And how do I find out what methods are available for a certain object or class? string1.getOwnPropertyNames() doesn't work.

@mgpai: Thanks for the YouTube script, I'll try it!
Reply With Quote
  #1646  
Old 16.01.2021, 10:52
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by SMS View Post
What's a graceful way to check whether a string is contained in another string? Both strings are variables, so it can't be a hardcoded regex pattern.
You can use String/RegExp Object methods:
Code:
str1.indexOf(str2) > -1; // boolean
new RegExp(str2).test(str1) // boolean
Quote:
Originally Posted by SMS View Post
Usually JavaScript offers string1.includes(string2), or the older string1.contains(string2), but neither work.

In general, what JavaScript version does the Event Scripter use?
JD uses Rhino/ES5 version. ES6 methods like 'includes' are not supported.

You can define your own prototype:
Code:
String.prototype.includes = function(str2) {
    return this.indexOf(str2) > -1;
}

//Usage
var result = "str1".includes("str2"); // boolean
Quote:
Originally Posted by SMS View Post
And how do I find out what methods are available for a certain object or class? string1.getOwnPropertyNames() doesn't work.
Code:
Object.getOwnPropertyNames(String);
Quote:
Originally Posted by SMS View Post
@mgpai: Thanks for the YouTube script, I'll try it!
You're welcome.
Reply With Quote
  #1647  
Old 18.01.2021, 20:51
tarkett tarkett is offline
Tornado
 
Join Date: Apr 2009
Location: Deutschland
Posts: 240
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Update when JD is Idle
// Trigger Required: "Interval"
// Set interval to 600000 (10 mins.) or more.

(function() {
    if (callAPI("update", "isUpdateAvailable") == false) return;
    if (callAPI("linkcrawler", "isCrawling")) return;
    if (callAPI("linkgrabberv2", "isCollecting")) return;
    if (callAPI("extraction", "getQueue").length > 0) return;
    if (callAPI("downloadcontroller", "getCurrentState") != "IDLE") return;
    callAPI("update", "restartAndUpdate");
})();
It is possible, that this script doesn't work on a headless system? On a desktop system it works fine.
The old version of this script (https://board.jdownloader.org/showthread.php?t=70525) works also on the headless system.

Best regards
tarkett

Last edited by tarkett; 18.01.2021 at 20:54.
Reply With Quote
  #1648  
Old 18.01.2021, 21:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by tarkett View Post
It is possible, that this script doesn't work on a headless system? On a desktop system it works fine.
The old version of this script works also on the headless system.
Seems quite possible.

This script uses MYJD API call to check the download controller state, while the other one uses the eventscripter method. This script uses "IDLE" status to check the sate. I just checked the source code and it seems there is also a "STOPPED_STATE" which the script does not take into account, and likely fails as a result. But not sure why it works in desktop and not in headless.

To avoid any confusion, I have replaced the MYJD API call in the script with the eventscripter method. Hopefully it should work fine in both.

Code:
/*
    Update when JD is Idle
    Trigger Required: "Interval" (Recommended: 600000 (10 mins.) or more)
*/

if (
    callAPI("update", "isUpdateAvailable") &&
    !callAPI("linkcrawler", "isCrawling") &&
    !callAPI("linkgrabberv2", "isCollecting") &&
    !callAPI("extraction", "getQueue").length &&
    isDownloadControllerIdle()
) {
    callAPI("update", "restartAndUpdate");
}

Thanks for the report.
Reply With Quote
  #1649  
Old 19.01.2021, 01:12
tarkett tarkett is offline
Tornado
 
Join Date: Apr 2009
Location: Deutschland
Posts: 240
Default

Many thanks for the very fast fix. I will test it.

Edit: Confirm, it works fine on both systems

Last edited by tarkett; 20.01.2021 at 23:53.
Reply With Quote
  #1650  
Old 21.01.2021, 13:38
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by tarkett View Post
Confirm, it works fine on both systems
Thanks for the feedback.
Reply With Quote
  #1651  
Old 29.01.2021, 18:07
KERNEL59 KERNEL59 is offline
Junior Loader
 
Join Date: Oct 2014
Posts: 10
Default

Hi ,

excuse me , i search tutorial for install the script please , does not work for me :(

Screenshot
Reply With Quote
  #1652  
Old 29.01.2021, 18:21
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by KERNEL59 View Post
... does not work for me
Check instruction in script:
Code:
// Trigger required: "A Download Stopped".

The script is executed when a download is completed. Your screenshot shows you have selected "A Download started" trigger. Select/change it to "A Download stopped".
Reply With Quote
  #1653  
Old 29.01.2021, 20:32
KERNEL59 KERNEL59 is offline
Junior Loader
 
Join Date: Oct 2014
Posts: 10
Default

Quote:
Originally Posted by mgpai View Post
Check instruction in script:
Code:
// Trigger required: "A Download Stopped".

The script is executed when a download is completed. Your screenshot shows you have selected "A Download started" trigger. Select/change it to "A Download stopped".
FiXED ; and for bitrate 128kbps to 320kbps where is it in the script ? thanx in advance
Reply With Quote
  #1654  
Old 30.01.2021, 12:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by KERNEL59 View Post
... for bitrate 128kbps to 320kbps where is it in the script ?
Transcoding drawbacks (wikipedia):
Quote:
The key drawback of transcoding in lossy formats is decreased quality. Compression artifacts are cumulative, so transcoding causes a progressive loss of quality with each successive generation, known as digital generation loss. For this reason, transcoding (in lossy formats) is generally discouraged unless unavoidable.
The script transcodes the file at the same bitrate as input. YT does not provide audio streams higher than 192kbps (in older formats) and 160kbps (in newer formats). Trancoding a file to higher bitrate than the source does not improve the quaility in anyway. If anything, it will be even worse. Transcoding itself from one lossy format to another (as in what is done by the script) should be avoided wherever possible.

That being said, the following script ignores the input bitrate and converts the file @320kbps.
Code:
/*
    Convert aac/m4a/ogg files to 320 kbps mp3.
    Trigger required: "A Download Stopped".
*/

if (link.finished) {
    var input = link.downloadPath;
    var output = link.downloadPath.replace(/(.+\.)(aac|m4a|ogg)$/i, "$1mp3");

    if (input != output) {
        var interfaceName = "org.jdownloader.controlling.ffmpeg.FFmpegSetup";
        var ffmpeg = callAPI("config", "get", interfaceName, null, "binarypath");

        callSync(ffmpeg, "-n", "-i", input, "-b:a", "320k", output);
        getPath(output).size && getPath(input).delete();
    }
}
Reply With Quote
  #1655  
Old 30.01.2021, 22:07
Tuscani Tuscani is offline
Baby Loader
 
Join Date: Apr 2014
Posts: 6
Default JDownloader Setup for Windows, Linux and Mac OS X witch Filebots AMC Script

Does this still apply? **External links are only visible to Support Staff**...
I ask because it is not working. I added the scripts in question to the Event Scripter and assigned each a trigger. But nothing happens


content of the jdownloader-postprocess.cmd (because Windows 10)
Code:
@ECHO OFF

:: Input Parameters
set ARG_PATH=%1
set ARG_NAME=%2
set ARG_LABEL=%3

:: Configuration
set CONFIG_OUTPUT=f:\

 "C:\Program Files\Filebot\filebot.exe" -script fn:amc --output %CONFIG_OUTPUT% --action duplicate --conflict skip -non-strict --log-file amc.log --def skipExtract=n unsorted=y music=n artwork=n clean=y excludeList=excludes.txt ut_dir=%ARG_PATH% ut_kind=multi ut_title=%ARG_NAME% ut_label=%ARG_LABEL%
Please see screenshots for more info. Any advice why nothing happens?
Attached Thumbnails
jdownloader1.JPG   jdownloader2.JPG   jdownloader3.JPG  

Last edited by Tuscani; 31.01.2021 at 16:25. Reason: spelling
Reply With Quote
  #1656  
Old 31.01.2021, 14:04
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by Tuscani View Post
I added the scripts in question to the Event Scripter and assigned each a trigger. But nothing hapens
Attachments can only be viewed by mods, so you will have to wait for them to check it and respond. But I can tell you nothing's changed in JD. So should be working fine by my account.
Reply With Quote
  #1657  
Old 31.01.2021, 16:24
Tuscani Tuscani is offline
Baby Loader
 
Join Date: Apr 2014
Posts: 6
Default JDownloader Setup for Windows, Linux and Mac OS X witch Filebots AMC Script

It is about this scritps mentioned here:
ht tps://ww w.filebot.net/forums/viewtopic.php?f=4&t=3478#p19358
Reply With Quote
  #1658  
Old 31.01.2021, 16:42
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by Tuscani View Post
It is about this scritps mentioned here ...
I guessed as much. Nothing has changed in JD, so it should work just fine. You can check the eventscripter log file in JD\logs folder for any errors. If you still have problems with troubleshooting, contact me in JD Chat:
Quote:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1659  
Old 07.02.2021, 23:41
dariotoby dariotoby is offline
Modem User
 
Join Date: Nov 2018
Posts: 3
Default

sorry I wanted to know if it was possible through this function to have a text file in the same folder when the link is captured or after the download is finished, where the file name is shown and next to the link captured, the download link. Thanks very kind.
Reply With Quote
  #1660  
Old 08.02.2021, 06:53
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,093
Default

Quote:
Originally Posted by dariotoby View Post
... have a text file in the same folder ... after the download is finished, where the file name is shown and ... the download link.
Code:
/*
    Write info to text file
    Trigger:  A Download stopped
*/

if (link.finished) {
    var name = link.name;
    var url = link.contentURL || link.pluginURL;
    var data = [name, url];

    var file = "linkInfo";
    var folder = link.package.downloadFolder;
    var filePath = getPath(folder + "/" + file + ".txt");

    writeFile(filePath, data.join(", ") + "\r\n", true);
}
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 03:57.
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 - 2021, Jelsoft Enterprises Ltd.