JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1321  
Old 20.04.2020, 18:44
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by drjs5x View Post
if skip link wait 1 seconds after next link check etc..
resume.
Sorry, but I am not able to understand what you are trying to achieve with the script.
Reply With Quote
  #1322  
Old 21.04.2020, 11:27
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

Dear mgpai,

for quite a while now I am using the script you generously wrote for my use-case. It allows me to play finished AND also partially downloaded files via the context menu.

It works really great! I would not want to miss it anymore. :-)

Now there is one little thing, which would make it even more convenient in my eyes. If this script would not just work on the file itself ... but already on its folder. (So the folder would not have to be opened before playing the file.)

Say dear mgpai ... could you extend the original script and add this feature? Or is this too much of a hassle?

This is the original script:

Code:
// Open finished or partially download file for the selected download link
// Trigger: Downloadlist Contextmenu Button Pressed
// Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open file" (without quotes) > Change Icon (Optional)

if (name == "[Script] Open file") {
    var link = dlSelection.getContextLink();

    if (link) {
        var player = "/videolan/vlc/vlc"; // <- Set path to media player
        var file = getPath(link.getDownloadPath());

        if (file.exists()) {
            callAsync(null, player, file);
        } else {
            var partFile = getPath(file + ".part");

            if (partFile.exists()) {
                callAsync(null, player, partFile);
            }
        }
    }
}
Reply With Quote
  #1323  
Old 21.04.2020, 14:22
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by Sokub View Post
... could you extend the original script ...
Code:
// Open selected folder in media player
// Trigger: Downloadlist Contextmenu Button Pressed
// Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open folder" (without quotes) > Change Icon (Optional)

if (name == "[Script] Open folder") {
    var package = dlSelection.getContextPackage();

    if (package) {
        var player = "/videolan/vlc/vlc"; // <- Set path to media player
        var folder = getPath(package.getDownloadFolder());
        
        callAsync(null, player, folder);
    }
}
Reply With Quote
  #1324  
Old 22.04.2020, 16:50
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

Dear mgpai, ... thank you for your work!

I'm sorry ... I guess, I expressed myself misleading. (I'm German.) Now the new script is playing the whole download-folder. But I was looking for it to just play the files from the "package-folder" (If that is the right name for the folders in the JD-download-list containing one or more "links/files".)

And also, I was looking for it to keep the old functionality too, so that it works/plays in all cases: 1. complete file or 2. incomplete file or 3. package-folder (with complete and incomplete files).

If this is too complicated, please just say so! ... it is not all that important, would just be really nice ... ;-)
Reply With Quote
  #1325  
Old 24.04.2020, 12:23
Mnk3y Mnk3y is offline
I will play nice!
 
Join Date: Apr 2020
Posts: 2
Default

Quote:
Originally Posted by mgpai View Post
Can use packagizer rules to move/rename files after extraction.
Hello, thanks for the answer. Unfortunately I couldn't make it work with packagizer. But I am currently working on a bash script which I want to run with JDownloader.

I am using a function for the event scripter from you.
**External links are only visible to Support Staff****External links are only visible to Support Staff**
But my bash script will be executed twice. I can see that by simply echoing something in the bash script.

How can I prevent this? Many thanks in advance.
Reply With Quote
  #1326  
Old 24.04.2020, 14:31
gerijani gerijani is offline
Modem User
 
Join Date: Apr 2020
Posts: 4
Default

Hi mgapi,

I was redirected to here to ask if is there sany script which can help to prevent this?

"We have blocked your account because our security systems have flagged your Pluralsight account for an unusual amount of activity. This means a high volume of requests have occurred every 10-30 seconds for a prolonged period of time. Please note that this high volume of activity is in violation of our terms of service"

After I put about 10 link of learning paths and shortly after the linkgrabber started to extract the video links, it happened.
Anything that can slow down the process?
Many thanks in advance.

Last edited by gerijani; 24.04.2020 at 14:34.
Reply With Quote
  #1327  
Old 24.04.2020, 14:33
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by Mnk3y View Post
... I couldn't make it work with packagizer ...
I would still recommend using packagizer. You can find me in JD Chat if you need help with it.

Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader

Quote:
... my bash script will be executed twice.
Not sure what is causing it. Since you want to run it after extraction, better to use archive extraction trigger. Does the bash script process the folder or individual files?
Reply With Quote
  #1328  
Old 24.04.2020, 14:43
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by gerijani View Post
After I put about 10 link of learning paths and shortly after the linkgrabber started to extract the video links, it happened.
Anything that can slow down the process?
If you are adding the links from a script, you can use MYJD API methods to wait till the crawler job is finished and then add the next link.

You can also try reducing the max. threads used by checker and crawler. Try setting both to 1.

Advanced settings:
Code:
LinkChecker.maxthreads
LinkCrawler.maxthreads
Reply With Quote
  #1329  
Old 27.04.2020, 11:51
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by Sokub View Post
... the new script is playing the whole download-folder.
The script does not send the contents of the 'package', It only sends the download destination used by it. It is then up to the external program to load files from it. Hence, ff you are using the same download destination with other packages, they will be loaded too. As will be will any other files from that package, even if they are not currently on JD list.

Code:
// Open selected package
// Trigger: Downloadlist Contextmenu Button Pressed
// Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open package" (without quotes) > Change Icon (Optional)

if (name == "[Script] Open package") {
    var package = dlSelection.getContextPackage();

    if (package) {
        var player = "/videolan/vlc/vlc"; // <- Set path to media player
        var files = [];

        package.getDownloadLinks().filter(function(link) {
            return link.getBytesLoaded();
        }).forEach(function(link) {
            var file = link.getDownloadPath();
            file = link.isFinished() ? file : file + ".part";
            files.push("\"" + file + "\"");
        })

        if (files.length) callAsync(null, player, files.join(" "));
    }
}
Reply With Quote
  #1330  
Old 28.04.2020, 09:56
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

Dear mgpai,

thank you very much for your effort!

Unfortunately I did not get your script to work. The player opens only if the script is triggered from a package ... but not if triggered from a single file. But the opened player does not play the file for unknown (to me) reasons.

I managed to combine two of your earlier scripts for me (originally for separate purposes) ... and this comes pretty close: the player plays when triggered from a package and also when triggered from a single file. The only drawback: If the package contains more than one file, it opens many players (instead of putting them in a single playlist.)

As a workaround: Can you give me a hint, how to exit the loop, when the first file to play has been found? (So the playlist won't be filled, but at least I don't have a ton of open players.)


Code:
if (name == "Play") {
    var links = dlSelection.getLinks();

    if (links.length) {
        links.forEach(function(link) {
            var player = "/usr/bin/smplayer"; // <- Set path to media player
            var file = getPath(link.getDownloadPath());

            if (file.exists()) {
                callAsync(null, player, file);
            } else {
                var partFile = getPath(file + ".part");

                if (partFile.exists()) {
                    callAsync(null, player, partFile);
                }
            }
        })
    }
}
Reply With Quote
  #1331  
Old 28.04.2020, 10:11
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by Sokub View Post
Unfortunately I did not get your script to work. The player opens only if the script is triggered from a package ... but not if triggered from a single file.
As the button name suggests, it only opens a package content. It is not supposed to work on file selection. For that you you will have to use the old script. I have also tested it before posting, and made sure the files were correctly being played.
Reply With Quote
  #1332  
Old 28.04.2020, 11:57
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

Ok, mgpai, thank you very much!
Reply With Quote
  #1333  
Old 28.04.2020, 12:18
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Quote:
Originally Posted by Sokub View Post
Ok
If it still does't work, find me in JD Chat.

Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1334  
Old 28.04.2020, 13:05
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

I need the script to work for both packages and files ... so I stick with my latest version (combined out of 2 of yours). Thank you, mgpai, very much!
Reply With Quote
  #1335  
Old 28.04.2020, 14:47
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 957
Default

Code:
// Open selected files
// Trigger: Downloadlist Contextmenu Button Pressed
// Customize download list context menu > Add a new "Eventscripter Trigger" button > Rename it to "[Script] Open files" (without quotes) > Change Icon (Optional)

if (name == "[Script] Open files") {
    var player = "/videolan/vlc/vlc";

    dlSelection.getLinks().filter(function(link) {
        return link.getBytesLoaded();
    }).forEach(function(link) {
        var file = link.getDownloadPath();
        file = link.isFinished() ? file : file + ".part";
        callAsync(null, player, "--started-from-file", "--playlist-enqueue", file);
    })
}
Reply With Quote
  #1336  
Old 28.04.2020, 16:35
Sokub Sokub is offline
Mega Loader
 
Join Date: Feb 2018
Posts: 60
Default

Thanks again for your help!
Reply With Quote
  #1337  
Old 28.04.2020, 16:39
sherif011 sherif011 is offline
JD Alpha
 
Join Date: Jul 2018
Posts: 24
Default Data usage limit

Hi,
Can you make an event script to stop downloads when a predefined data limit is reached?
E.g: I want downloading to stop when a limit of 20 GB is reached.
I need it for all hosts with or without account, just an overall data limit for all sites.
Thank you..

Last edited by sherif011; 28.04.2020 at 17:39. Reason: clarification
Reply With Quote
  #1338  
Old 28.04.2020, 16:47
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 54,876
Default

@sherif011
Your post is missing information e.g.:
- Do you mean a quota of an account or do you download without account?
- For all hosts or only for a specified host?

-psp-
__________________
JD Supporter, Plugin Dev. & Community Manager

Erste Schritte & Tutorials || JDownloader 2 Setup Download
Spoiler:

A users' JD crashes and the first thing to ask is:
Quote:
Originally Posted by Jiaz View Post
Do you have Nero installed?
That's true James
Quote:
Originally Posted by James
Die Leute verstehen einfach nicht dass nur weil man mit einer Waffe auch auf Menschen schießen kann dass ein Schützenver​ein kein Ort für Amoklaufide​en ist
Reply With Quote
  #1339  
Old 28.04.2020, 17:40
sherif011 sherif011 is offline
JD Alpha
 
Join Date: Jul 2018
Posts: 24
Default

Quote:
Originally Posted by pspzockerscene View Post
@sherif011
Your post is missing information e.g.:
- Do you mean a quota of an account or do you download without account?
- For all hosts or only for a specified host?

-psp-
Updated
Reply With Quote
  #1340  
Old 29.04.2020, 16:39
_comus_ _comus_ is offline
Baby Loader
 
Join Date: Apr 2020
Posts: 9
Default

Someone could tell me a scrip, to know the history or all the folders or links, of the download list, I accidentally deleted it, in cleaning disabled and it is urgent for me to recover them
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 23:45.
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 - 2020, Jelsoft Enterprises Ltd.