JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1921  
Old 11.10.2021, 15:16
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@TomNguyen: Thank you so much for your help/time. Do you still have the postID to each script/or page? Then you could easily link the script/post directly?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1922  
Old 11.10.2021, 15:17
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@JDL1059: list of links? where does the new link come from then? is it normal text/website with links on it or how do you expect JDownloader to check for new links? more details are required in order to help/answer you
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1923  
Old 11.10.2021, 15:22
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@BillyCool: can you share the script/trigger? you can also send details to support@jdownloader.org
Most likely you are trying to access a special *retry* link in linkcrawler?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1924  
Old 12.10.2021, 04:20
BillyCool BillyCool is offline
Vacuum Cleaner
 
Join Date: Sep 2016
Location: Australia
Posts: 18
Default

@Jiaz

Here's a basic version that replicates the issue:
Code:
disablePermissionChecks();
setNotifyOnException(true);

// Run one at a time
test1(); // Causes: Security Violation --> Security Violation org.appwork.exceptions.WTFException
//test2(); // Causes: WTFException --> what the like just happened here? no lastValidFilePackage

function test1() {
    try {
        getAllCrawledLinks().forEach(function(link) {
            log(link.getPackage().getDownloadFolder()); // null when download path is default, otherwise works
            log(link.getDownloadPath()); // never works
        });
    } catch (ex) {
        log(ex);
    }
}

function test2() {
    getAllCrawledLinks().forEach(function(link) {
        log(link.getPackage().getDownloadFolder()); // null when download path is default, otherwise works
        log(link.getDownloadPath()); // never works
    });
}

function log(text) {
    writeFile(JD_HOME + '/testing.txt', text + getEnvironment().getNewLine(), true);
}
How I'm running it:
  • Running on 'None' trigger, as it's a work in progress (for now)
  • I run the script manually via 'Test Run' (for now)
  • As for the links, I'm testing with plain standard youtube links, but have tried others as well with the same results. Tried both single and multiple links in the same package.

Further findings/thoughts:
  • I get a more detailed error when not running in a try-catch, see comment in script. I'm not sure why, the exception doesn't seem to get caught as I get nothing in the log file.
  • Getting the download path through the package works when the download path is not your default download location. It might be intended to return null if it's the default, and the expectation is to get the default download path from settings using the API. For now, this is my workaround.
  • I'm not sure a crawled link should have "getDownloadPath()" in the first place. You can't change the download path of a link individually without changing it for the entire package. So it makes sense to me that if you want to get or set the download path, you do that via the package, not the link.
Reply With Quote
  #1925  
Old 12.10.2021, 05:31
TomNguyen TomNguyen is offline
Baby Loader
 
Join Date: Jul 2017
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@TomNguyen: Thank you so much for your help/time. Do you still have the postID to each script/or page? Then you could easily link the script/post directly?
I only save the name as the script can be found via search function at https://board.jdownloader.org/search...threadid=70525
I will try to update the list when new script posted by mgpai
Reply With Quote
  #1926  
Old 12.10.2021, 11:06
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@TomNguyen: Thanks for the followup!

@BillyCool: Thanks for the feedback. Both will be fixed with next core update.

Quote:
Originally Posted by BillyCool View Post
[*]Getting the download path through the package works when the download path is not your default download location. It might be intended to return null if it's the default, and the expectation is to get the default download path from settings using the API. For now, this is my workaround.
-> with next core update the full absolute path will be returned and no longer need to build the path for yourself



Quote:
Originally Posted by BillyCool View Post
[*]I'm not sure a crawled link should have "getDownloadPath()" in the first place. You can't change the download path of a link individually without changing it for the entire package. So it makes sense to me that if you want to get or set the download path, you do that via the package, not the link.
-> was designed that way to be able to use the same *way* for DownloadLink or CrawledLink instances. It's just a get method, there are no intentions to support setting of path
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 12.10.2021 at 11:43.
Reply With Quote
  #1927  
Old 12.10.2021, 11:51
BillyCool BillyCool is offline
Vacuum Cleaner
 
Join Date: Sep 2016
Location: Australia
Posts: 18
Default

@Jiaz Cheers
Reply With Quote
  #1928  
Old 12.10.2021, 11:55
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@BillyCool: update will be available in about 5 minutes
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1929  
Old 12.10.2021, 14:28
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

Quote:
Originally Posted by Jiaz View Post
@JDL1059: list of links? where does the new link come from then? is it normal text/website with links on it or how do you expect JDownloader to check for new links? more details are required in order to help/answer you
@Jiaz: What is this about? Can't seem to find related post in this thread.
Reply With Quote
  #1930  
Old 12.10.2021, 14:42
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@mgpai: see, https://board.jdownloader.org/showpo...postcount=1919
deleted it by accident
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1931  
Old 12.10.2021, 18:25
BillyCool BillyCool is offline
Vacuum Cleaner
 
Join Date: Sep 2016
Location: Australia
Posts: 18
Default

@Jiaz Tested and confirmed working. Thanks again!
Reply With Quote
  #1932  
Old 12.10.2021, 19:44
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@BillyCool: Thanks for the feedback and you're welcome
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1933  
Old 13.10.2021, 20:52
Crais Crais is offline
Baby Loader
 
Join Date: Jan 2021
Posts: 6
Default

Hello folks,

Hello folks,
I would like to move a package after downloading (and automatically unpacking) to another directory, e.g. for a video download the whole folder including content.
Can anyone help me?

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

Last edited by Jiaz; 14.10.2021 at 12:07.
Reply With Quote
  #1934  
Old 14.10.2021, 14:00
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 1,371
Default

Quote:
Originally Posted by Crais View Post
... move a package after downloading ...
Code:
/*
    Move extracted files
    Trigger: Archive extraction finished
*/

var source = "c:\\downloading";
var destination = "d:\\finished";

archive.extractedFilePaths.forEach(function(filePath) {
    var newFolder = filePath.parent.toString().replace(source,destination);
    filePath.moveTo(newFolder);
})
Reply With Quote
  #1935  
Old 14.10.2021, 19:16
Crais Crais is offline
Baby Loader
 
Join Date: Jan 2021
Posts: 6
Default

Unfortunately, this does not work. jD gives the error message "missing; before statement (#1)"
Reply With Quote
  #1936  
Old 15.10.2021, 10:41
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@Crais: Just copied/pasted and working fine here. Please make sure to copy the script only, the information in comment section is how to setup the script
__________________
JD-Dev & Server-Admin
Reply With Quote
  #1937  
Old 16.10.2021, 08:53
BillyCool BillyCool is offline
Vacuum Cleaner
 
Join Date: Sep 2016
Location: Australia
Posts: 18
Default

@Jiaz I actually found another issue with CrawledLink.getDownloadPath(). It looks like name changes do not reflect in the output. Here's a sample script with 'None' trigger:

Code:
disablePermissionChecks();

getAllCrawledLinks().forEach(function(link) {
    log("BEFORE: Download path: " + link.getDownloadPath()); // Correct
    log("BEFORE: Name: " + link.getName()); // Correct
    
    link.setName(link.getName() + ".temp");
    
    log("AFTER: Download path: " + link.getDownloadPath()); // Incorrect, still outputs old name in the download path
    log("AFTER: Name: " + link.getName()); // Correct
})

function log(text) {
    writeFile(JD_HOME + '/testing.txt', text + getEnvironment().getNewLine(), true);
}
The script simply appends ".temp" to all files in the link grabber. It logs the download path and name before and after the change. The name is updated, the download path is not. In the UI and when downloading those files, the updated name is shown/used, so no issues there. Workaround is simple, we can construct the correct download path using package folder and link name.
Reply With Quote
  #1938  
Old 17.10.2021, 07:02
JDL1059 JDL1059 is offline
I will play nice!
 
Join Date: Oct 2021
Posts: 5
Default

Quote:
Originally Posted by Jiaz View Post
@JDL1059: list of links? where does the new link come from then? is it normal text/website with links on it or how do you expect JDownloader to check for new links? more details are required in order to help/answer you

Hi Jiaz - it would be a list of links i manually input (it could be added to a textfile, or pasted into the jdownloader app itself). I'm not sure exactly the best method, but essentially say i have a list of 10 links that i would like jdownloader to check maybe once a day / week if new files have been added. Over time i would add more links to that said text file.
Reply With Quote
  #1939  
Old 18.10.2021, 10:48
schnacke schnacke is offline
Modem User
 
Join Date: Oct 2021
Posts: 3
Default

Hello i need some help,
i'm running jd2 on a docker container and filebot in another docker container, now i want to run filebot after extraction, i wrote a shell script with a ssh command.
My script is running from the command line but in jd2 i got a failure.

Thanks for help an sorry for my english
Attached Images
File Type: png script.png (12.1 KB, 1 views)
File Type: png alert_message_eventscripter.png (73.4 KB, 1 views)
Reply With Quote
  #1940  
Old 18.10.2021, 12:21
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 72,936
Default

@BillyCool: thanks for the report. Will be fixed with next update

@schnacke: sure you have tested that script from within your container (join container and run manually)? the error comes directly from script/environment and looks like some missing environment variables, see
superuser.com/questions/782509/unable-to-ssh-cannot-create-dev-null-ssh
stackoverflow.com/questions/27663032/boot2docker-command-works-on-shell-but-not-in-script

@JDL1059: thanks for the feedback, try to ask mgpai for help with this
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 18.10.2021 at 12:29.
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 09:41.
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.