JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1421  
Old 19.06.2020, 21:51
OCHer OCHer is offline
Junior Loader
 
Join Date: Jan 2020
Posts: 10
Default

Quote:
Originally Posted by mgpai View Post
Code:
// Call external program
// Trigger: Archive extraction finished

disablePermissionChecks();

if (isDownloadControllerIdle() && !callAPI("extraction", "getQueue").length) callSync("synoindex", "-R", "video");

This should call the external program if no downloads are running and last archive file has been extracted. Install the script in JD with GUI and copy the JSON value from advanced settings.
Hi mgpai, I tried but unfortunately my Synology DiskStation does not execute the command "synoindex -R video".
I have set this in MyJDownloader EventScripter: Scripts:
Code:
[ {
  "eventTrigger" : "ON_ARCHIVE_EXTRACTED",
  "enabled" : true,
  "name" : "Synology Videoordner nach entpacken indizieren",
  "script" : "disablePermissionChecks();\n\nif (isDownloadControllerIdle() && !callAPI(\"extraction\", \"getQueue\").length) callSync(\"synoindex\", \"-R\", \"video\");",
  "eventTriggerSettings" : {
    "isSynchronous" : false
  },
  "id" : anonymus
} ]
Can you please take a look at what might be wrong?
Reply With Quote
  #1422  
Old 20.06.2020, 07:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by OCHer View Post
... unfortunately my Synology DiskStation does not execute the command ...
Script is working fine. It will run the external command, after an archive is extracted, only when if the download controller is idle.

If you are still having problem with the script, you can find me in JD Chat.:

Code:
kiwiirc.com/nextclient/irc.freenode.net/#jdownloader
Reply With Quote
  #1423  
Old 20.06.2020, 15:50
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

Quote:
Originally Posted by Dockel View Post
Is there a way in the link grabber window to choose a special variant of the resolution of more than a single YouTube video in a single step? For example, all (selected, may be 100) videos in the link grabber shall be downloaded with 480p.
Quote:
Originally Posted by mgpai View Post
Possible only if the exact same variant is available for all the 100 links in the selection, which considering the long list of variants, is very unlikely. It might be easier to add a selection of multiple variants of a link to the list and then use a script or the side bar view filter to discard the unwanted ones.
Quote:
Originally Posted by mgpai View Post
It might be easier to add a selection of multiple variants of a link to the list and then use a script or the side bar view filter to discard the unwanted ones.
Yes, that sounds good, how does one do that?

Quote:
Can you not achieve the desired result tweaking the YT variant selection algorithm in advanced settings? It is highly configurable.
I will have a look at it, thank you. These settings are meant(?):


Quote:
re: youtube change variant, might be just easier to change plugin settings just delete the entries, add them back again. There is cache so they wont have to scrape each video again. All info is retained in memory, so this will work on assumption you just added them.
Sorry, I do not understand. What did I have to do? Change some settings in the YouTube part of JD?
__________________
Aktuelles Windows

Last edited by Dockel; 20.06.2020 at 15:54.
Reply With Quote
  #1424  
Old 20.06.2020, 16:55
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,195
Default

@Dockel
not youtube website, JD > settings > plugins > youtube
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #1425  
Old 20.06.2020, 20:22
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

So change the settings there. Very many settings. And when I want other variants of videos (than 480p) I would have to reset the settings each time.
__________________
Aktuelles Windows
Reply With Quote
  #1426  
Old 22.06.2020, 18:48
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by Dockel View Post
Is there a way in the link grabber window to choose a special variant of the resolution of more than a single YouTube video in a single step? For example, all (selected, may be 100) videos in the link grabber shall be downloaded with 480p.
Seems it's already possible to do that. I don't use YT much, so wasn't aware of it till I checked it today.
  1. Select the links (for e.g 100 links)
  2. Context menu > youtube.com > Change Video Variant for 100 link/s
  3. This will open a new variant window.
  4. Optionally, use the drop-down menu at the top to hide variants by their attribute.
  5. Sort the list (For e.g. by "Height" or "Links" column)
  6. Check the 'Links' column to find if a variant is available for all the selected links. (e.g. when a variant is available for all the selected 100 links, it will read 100/100)
  7. Double-click the preferred variant or select it and press the 'Select' button at the bottom of the window.
Reply With Quote
  #1427  
Old 22.06.2020, 21:16
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

Thank you for checking.

Quote:
Context menu > youtube.com > Change Video Variant for 100 link/s
I am even failing finding the youtube.com item anywhere (in the context menu or else):


Where could I find it?
__________________
Aktuelles Windows

Last edited by Dockel; 22.06.2020 at 21:26.
Reply With Quote
  #1428  
Old 22.06.2020, 22:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by Dockel View Post
Where could I find it?
It is in the context menu by default.

Reply With Quote
  #1429  
Old 22.06.2020, 22:10
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

Yes, but here it is not:


And I even cannot find it in the menu cusstomizer / offline menu manager or so. I do not have any idea how to add it. I assume, a long time ago I removed it, but I cannot remember it.
__________________
Aktuelles Windows
Reply With Quote
  #1430  
Old 22.06.2020, 22:16
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by Dockel View Post
I even cannot find it in the menu cusstomizer / offline menu manager or so. I do not have any idea how to add it.
Menu Item Name: Plugin Menu Entries (Component)
Reply With Quote
  #1431  
Old 22.06.2020, 22:20
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

Sorry, what do I have to do with it:
__________________
Aktuelles Windows
Reply With Quote
  #1432  
Old 22.06.2020, 22:25
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by Dockel View Post
Sorry, what do I have to do with it:
Click "Add". Any entries available for a plugin which is used for the particular link, will then appear in the context menu.
Reply With Quote
  #1433  
Old 22.06.2020, 22:56
Dockel Dockel is offline
JD Adviser
 
Join Date: Feb 2020
Posts: 108
Default

Ah yes, now it is available.



And here I can select the resolutions:


Thank you very much!
__________________
Aktuelles Windows
Reply With Quote
  #1434  
Old 27.06.2020, 09:18
bdrifter bdrifter is offline
Modem User
 
Join Date: Jun 2020
Posts: 3
Default

Hello,

I'm trying to use the Event Scripter to prune incoming link packages from a specified domain, leaving only the largest file, while discarding the rest.

But I can't for the life of me find any documentation that clearly describes when and where each Trigger is triggered. For example, when is Package Finished triggered? Or Package Hook?

Apologies for being completely clueless, much appreciation for anyone willing to point me in a direction.

Thanks
Reply With Quote
  #1435  
Old 27.06.2020, 10:34
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by bdrifter View Post
... when is Package Finished triggered? Or Package Hook?
  • Package Finished = Returns a 'download package' object when it is finished.
  • Packagizer Hook = Returns a 'packagizer link' object before it is added to the linkgrabber list.

Neither of them are suitable for your use case. There aren't any event triggers which will work out of the box (in this case) either. You will have to use "A new link was added" trigger, and use the 'packagizer link' object returned by it to get the relevant 'crawled link' objects, and query/match/remove them from list.
Reply With Quote
  #1436  
Old 27.06.2020, 17:49
sherbee sherbee is offline
JD Fan
 
Join Date: Mar 2019
Posts: 76
Default

Quote:
Originally Posted by mgpai View Post
Loop through extracted file paths (array):

Code:
var myFilePath[] = myArchive.getExtractedFilePaths();
I tested but I think not correct.
myArchive.getExtractedFilePaths() gives path from extracted file.
But I need full path and name of archive/archive parts from manual open beacause I want move archive after extract.

Last edited by sherbee; 27.06.2020 at 17:55.
Reply With Quote
  #1437  
Old 27.06.2020, 18:54
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by sherbee View Post
... I need full path and name of archive/archive parts from manual open ...
Code:
var filePaths = archive.getExtractionLog().match(/\(FileArchiveFile\)File:[^|]+/g).map(function(filePath) {
    return filePath.replace(/.+?:(.+)/, "$1");
});

alert(filePaths.join("\n"));
Reply With Quote
  #1438  
Old 30.06.2020, 03:36
woriamu woriamu is offline
Junior Loader
 
Join Date: Jun 2020
Posts: 12
Default

I'm looking for a script that I can run periodically that will reset a link if status = Finished and size = 0 bytes. Basically resetting anything that looks like this. I spoke more about this issue here.

https://board.jdownloader.org/showthread.php?t=84716

If anyone could help me make this script I would be very grateful.
Reply With Quote
  #1439  
Old 30.06.2020, 08:12
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 939
Default

Quote:
Originally Posted by woriamu View Post
... script ... that will reset a link if status = Finished and size = 0 bytes. ...
Note: This script will delete links from the download list. Keep a backup of link list before running the script.

Code:
// Reset finished link, if size is zero bytes
// Trigger: A Download Stopped

if (link.finished && !link.bytesTotal) {
    link.reset();
}
Reply With Quote
  #1440  
Old 30.06.2020, 20:36
Rabelux Rabelux is offline
DSL User
 
Join Date: Oct 2018
Posts: 38
Lightbulb

As it took me a few hours to get it done im posting my code for anyone who wants to send a finished download to a remote machine via scp.
This is a follow-up post of my last post in Dec '19.

OS: Linux with public key auth on remote server
Code:
disablePermissionChecks();
if (link.isFinished()) {
    var sourceFile = link.getDownloadPath();
    var result = callSync("scp", "-P <portnr>", sourceFile, "<user>@<IP_of_destination>:/<filepath>");
    var exitcode = callSync("sh", "-c", "echo $?").trim();
    log("scp-output: " + result);
    log("Exit Code: " + exitcode);
    if (exitcode == "0") {
        deleteFile(sourceFile, false); //false=non-recursive
        log("DELETED " + link.getName());
    }
    if (package.isFinished()) package.remove();
}
I guess there is still room for optimization, for example a more elegant solution might be
Code:
callSync("sh", "-c", "scp -P <portnr> " + sourceFile + " <user>@<IP_of_destination>:/<filepath> && rm " + sourceFile);
but I'm happy with it the way it is.
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 11:39.
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.