JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1621  
Old 11.12.2020, 17:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by default63 View Post
... help me to find a solution.
'Download stopped' trigger can be used, but with additional check. LIke check if the link and its packge is also finished. But since the archive extraction will run post download, it is not suitable in your case.

You can use 'package finished' tirgger, for packages which do not contain archves and 'archive extraction finished' trigger, for packages whic contain arcihves.

It may not necessary to create any text file for 'package finised' since it is triggered only, unless of course you add new links to it or reset the existing ones. Archive extractiion is also triggered only once, unless you extract it manually again. I guess that would be unlikely since the files would have been moved to a different location on the previous trigger, and the link in JD will not ablle to extract it, since the new file path is not associated with links in the link list.

Can use bash script, but also might be possible to use eventscripter methods to move them. Let me know how you wish to proceed.
Reply With Quote
  #1622  
Old 11.12.2020, 17:55
default63 default63 is offline
I will play nice!
 
Join Date: Dec 2020
Posts: 2
Default

Hi Mgpai,
thanks for your reply! If it is possible the evensripter-solution would be great.

Greetings
Default63
Reply With Quote
  #1623  
Old 11.12.2020, 19:02
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by default63 View Post
If it is possible the evensripter-solution would be great.
Should be possible. Find me in JD Chat.
Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1624  
Old 24.12.2020, 23:52
dereks10 dereks10 is offline
Vacuum Cleaner
 
Join Date: Sep 2020
Posts: 16
Default

Hello, would it be easy for someone to provide me a call for a Resume script. Thats all. Just every 10 min or so to call to Resume downloads. I download alot from my media server that for some reason just stops my downloads randomly. I dont have to do anything but press resume ( or Start Downloads button ) and it continues where it left off.
Thanks for any help.
Reply With Quote
  #1625  
Old 25.12.2020, 07:00
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by dereks10 View Post
... every 10 min or so to call to Resume downloads.
It would be better to fix the underlying issue. If you provide example links and log the developers might be able to check it.

The download controller is stopped only when all attempts to start/resume pending downloads have failed. In which case, they will be skipped with a relevant message displayed in the 'status' column. Do you see any such message in that column?
Reply With Quote
  #1626  
Old 27.12.2020, 01:26
dereks10 dereks10 is offline
Vacuum Cleaner
 
Join Date: Sep 2020
Posts: 16
Default

Quote:
Originally Posted by mgpai View Post
It would be better to fix the underlying issue. If you provide example links and log the developers might be able to check it.

The download controller is stopped only when all attempts to start/resume pending downloads have failed. In which case, they will be skipped with a relevant message displayed in the 'status' column. Do you see any such message in that column?
Well thats the thing, it doesnt provide any info. It just stops like its been paused and the status field is blank. I will post a log next time, but to do that iu just need to go to Help - Create a log - choose the timeframe, and then create a new topic to paste it in?
Ive been playing around with some scripts way back in this post that pauses and resumes a download after the speed reached a certian point. I edited it to make it 1kbps and it definatly has helped. But it still occasionaly does it, like maybe once a day which is annoying in my situation. Here is the script i use. I did not make this script i just edited the speed.

Code:
if (isDownloadControllerRunning() && !isDownloadControllerStopping()) {
    var running = getRunningDownloadLinks();
    //loop through all running Downloads
    for (var i = 0; i < running.length; i++) {
        //check if the download has been running at least 30 seconds
        if (running[i].getDownloadDuration() > 30000) {
            //check if the current speed is below 1kb/s
            if (running[i].getSpeed() < 1 * 1024) {
                //resume the download
                //running[i].resume();
                //stop the download and resume it
                running[i].abort();
            }

        }
    }
}

Last edited by dereks10; 27.12.2020 at 01:33.
Reply With Quote
  #1627  
Old 27.12.2020, 06:20
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by dereks10 View Post
... create a new topic to paste it in?
You can post the log ID in this thread. The developers may be able to check/fix the issue or provide me the necessary information to create a script.

In the meanwhile, you can also try THIS script.
Reply With Quote
  #1628  
Old 27.12.2020, 09:13
dereks10 dereks10 is offline
Vacuum Cleaner
 
Join Date: Sep 2020
Posts: 16
Default

Quote:
Originally Posted by mgpai View Post

In the meanwhile, you can also try **External links are only visible to Support Staff**... script.
Very Clean. Thank you it works very well. I just lowered speed a bit on it. Exactly what i was looking for. The one i was using was hit or miss.
Reply With Quote
  #1629  
Old 27.12.2020, 09:26
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,374
Default

@dereks10
status / error messages are usually present until you restart the client.
or
Just not displayed maybe due to another attempt at downloading without error

if you double click (this triggers the tooltip display, tool tips cant be disabled in advanced settings either) the status column (not package, only download links) you can see which download candidates used and which ones had errors. tooltips
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]

Last edited by raztoki; 27.12.2020 at 09:28.
Reply With Quote
  #1630  
Old 28.12.2020, 00:06
Kaelthas Kaelthas is offline
JD Alpha
 
Join Date: Aug 2018
Posts: 22
Default

The M4A to mp3 converter script keeps crashing on line 17 after a while of download. Was there a fix to it?
Reply With Quote
  #1631  
Old 28.12.2020, 05:06
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by Kaelthas View Post
The M4A to mp3 converter script keeps crashing on line 17 after a while of download. Was there a fix to it?
The script just passes the command to ffprobe, which fails to return valid JSON data. Most likely caused by ffprobe version which is not compatible (or corrupted?) with the encoded file. Can be confirmed by running the following command in the terminal/cmd window, on the media file which causes the crash.

Quote:
<path/to/ffprobe> -print_format json -show_streams -show_format <path/to/mediafile>
If confirmed, upgrading/replacing ffmpeg with a compatible version/new copy should fix it.
Reply With Quote
  #1632  
Old 29.12.2020, 09:24
Kaelthas Kaelthas is offline
JD Alpha
 
Join Date: Aug 2018
Posts: 22
Default

When the thing crash, it came up with "SyntaxError: Unterminated Object Literal (#17)". When I reboot Jdownloader, it works again, and it's not just limited to just one file but seemingly at random, but when there is a long list of files to process. The minimum so far was 10 files. Also, I'm barely entry level in terms of programming and such, so I don't know what it means when you tell me to run that command string. I also don't know how to upgrade or replace the ffmpeg, as I googled and can't find an .exe file to do so.

Last edited by Kaelthas; 29.12.2020 at 09:52.
Reply With Quote
  #1633  
Old 29.12.2020, 10:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,640
Default

@Kaelthas:
can you provide screenshot of the shown error?
Does it happen for the same file or does the file work after restart?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1634  
Old 30.12.2020, 01:09
Kaelthas Kaelthas is offline
JD Alpha
 
Join Date: Aug 2018
Posts: 22
Default

It just come up with a dialog box with that message. It's happening seemingly at random at no particular one file. The process works again after a restart and having to re-download the thing to trigger the process.
Reply With Quote
  #1635  
Old 30.12.2020, 08:55
Kaelthas Kaelthas is offline
JD Alpha
 
Join Date: Aug 2018
Posts: 22
Default

Quote:
Originally Posted by Jiaz View Post
@Kaelthas:
can you provide screenshot of the shown error?
Does it happen for the same file or does the file work after restart?
Here is the attached screenshots.
Attached Thumbnails
Untitled.jpg   Untitled2.jpg  
Reply With Quote
  #1636  
Old 30.12.2020, 10:13
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,640
Default

Thanks
@mgpai: could you modify the script with debug, to write out the result of ffprobe to disk so we know what it returns and finally fail?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1637  
Old 30.12.2020, 10:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by Jiaz View Post
... script with debug, to write out the result of ffprobe to disk ...
Code:
// 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 json = callSync(ffprobe, "-v", "quiet", "-print_format", "json", "-show_streams", "-show_format", sourceFile);

        writeFile(JD_HOME + "/ffrpobe output.txt", json + "\r\n\r\n", true); // will be created in JDownloader install folder

        try {
            var data = JSON.parse(json);
            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 = false; // Set this to true to delete source file after conversion.

            if (bitrate > 0) {
                callSync(ffmpeg, "-y", "-i", sourceFile, "-b:a", bitrate + "k", destFile);
                if (deleteSourceFile && getPath(destFile).exists()) deleteFile(sourceFile, false);
            }
        } catch (e) {
            alert("Could not convert " + sourceFile);
        }
    }
}
Reply With Quote
  #1638  
Old 06.01.2021, 12:51
user135711 user135711 is offline
DSL Light User
 
Join Date: Jul 2018
Posts: 34
Default

In your youtube download to html page script, why do you call .prop() on string literals and not jquery selectors? "YT_VARIANT".prop()
Reply With Quote
  #1639  
Old 07.01.2021, 07:35
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,339
Default

Quote:
Originally Posted by user135711 View Post
In your youtube download to html page script, why do you call .prop() on string literals and not jquery selectors? "YT_VARIANT".prop()
Code:
// Get link property
String.prototype.prop = function() {
    return link.getProperty(this);
};

It is not a a JQuery method. It is prototype added by me to the Javascript String object and named as such by sheer coincidence.
Reply With Quote
  #1640  
Old 08.01.2021, 16:57
SMS SMS is offline
Wind Gust
 
Join Date: Jun 2019
Posts: 41
Default

How do I tell the Event Scripter to add/download a certain link to a different custom local filnename (instead of the original online filename)?

addLinks doesn't seem to have a "filename" or "saveAs" argument.

Also the myObject coming out of
myObject = callAPI("linkgrabberv2", "addLinks", {"links": myURL});
doesn't seem to have .setName()
What methods and properties does it have, how do I use it? The API documentation says that it's a boolean, but I see an number called "id" inside.

Maybe I should somehow use renameLink, but how do I get the linkId from myObject? If I try to use myObject or myObject.id as the linkID, I get a null pointer exception.

Last edited by SMS; 08.01.2021 at 18:46.
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 00:11.
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.