JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 24.09.2022, 16:04
nicolau nicolau is offline
Baby Loader
 
Join Date: Mar 2021
Posts: 6
Default Use url structure as subfolders

I would like to recreate the structure of the subfolders of the URL and place the file inside the last folder. I already tried the tutorials but JDownloader only creates the last folder of the URL.

My default downloads folder is "D:\JDownloader\Downloads"

Test URL: **External links are only visible to Support Staff****External links are only visible to Support Staff**

I would like this structure to be created:

"D:\JDownloader\Downloads\2 - Flashcards\MedCards - Atualizado 2022\MC - Cirurgia\Queimaduras.apkg"

Best regards!
Reply With Quote
  #2  
Old 25.09.2022, 12:00
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

@nicolau: can you show your rule? so we can check/tell you what you did wrong?
Either a screenshot or export the rule and attach here or send to support@jdownloader.org
__________________
JD-Dev & Server-Admin
Reply With Quote
  #3  
Old 25.09.2022, 12:34
nicolau nicolau is offline
Baby Loader
 
Join Date: Mar 2021
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@nicolau: can you show your rule? so we can check/tell you what you did wrong?
Either a screenshot or export the rule and attach here or send to support@jdownloader.org

Now I'm trying to create a script. The script would take the url and move it to the folder referring to the url. But without success so far.

Code:
if (link.isFinished()) {
    var url = link.getContentURL();
    alert(url+"\r\n");
    var url = url.replace('\\','/');
    alert(url+"\r\n");
    getPath(link.getDownloadPath()).moveTo(destFolder);
}
The code above is incomplete. I can't replace de backslash on test to continue the code.

Last edited by Jiaz; 25.09.2022 at 13:30.
Reply With Quote
  #4  
Old 25.09.2022, 13:30
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

@nicolau: Thanks. I thought you already tried via packagizer rules
Create a Settings->Packagizer Rule->
Code:
if
sourceURL - contains - .*exvsnprkvb\.one/([^/]*)/([^/]*)/([^/]*)/[^/]*
(enable regex checkbox)
then set
download folder - <jd:source:1>/<jd:source:2>/<jd:source:3>
the rule will place the link into wished folder when you add the link. rules are only processed when adding links.
__________________
JD-Dev & Server-Admin

Last edited by Jiaz; 25.09.2022 at 13:32.
Reply With Quote
  #5  
Old 25.09.2022, 13:33
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

Quote:
Originally Posted by nicolau View Post
The code above is incomplete. I can't replace de backslash on test to continue the code.
What exactly do you mean? backslash on test?
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 25.09.2022, 13:36
nicolau nicolau is offline
Baby Loader
 
Join Date: Mar 2021
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
What exactly do you mean? backslash on test?

I would like to change de destination folder:

"D:\JDownloader\Downloads\Queimaduras\Queimaduras.apkg"

To:

"D:\JDownloader\Downloads\2 - Flashcards\MedCards - Atualizado 2022\MC - Cirurgia\Queimaduras.apkg"

A relative path local to the original url

Last edited by nicolau; 25.09.2022 at 13:39.
Reply With Quote
  #7  
Old 25.09.2022, 13:43
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

@nicolau: my example packager rule does exactly this, see https://board.jdownloader.org/showpo...79&postcount=4
with that rule your downloads will go to right directory in first place and not have to move after downloads. You have to adapt the rule in order to different number of *subfolders*
__________________
JD-Dev & Server-Admin
Reply With Quote
  #8  
Old 25.09.2022, 14:19
nicolau nicolau is offline
Baby Loader
 
Join Date: Mar 2021
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@nicolau: Thanks. I thought you already tried via packagizer rules
Create a Settings->Packagizer Rule->
Code:
if
sourceURL - contains - .*exvsnprkvb\.one/([^/]*)/([^/]*)/([^/]*)/[^/]*
(enable regex checkbox)
then set
download folder - <jd:source:1>/<jd:source:2>/<jd:source:3>
the rule will place the link into wished folder when you add the link. rules are only processed when adding links.
This works well. But how to proced on links with variable number of directories? Example:

**External links are only visible to Support Staff**www.site.com/dir1/dir2/dir3/file1.ext
**External links are only visible to Support Staff**www.site.com/dir1/dir2/dir3/dir4/file2.ext
**External links are only visible to Support Staff****External links are only visible to Support Staff**

Is possible to do this with one only package ruler?

Last edited by nicolau; 25.09.2022 at 14:21.
Reply With Quote
  #9  
Old 25.09.2022, 14:24
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

@nicolau: unfortunately at the moment it's not yet possible. So you have to create rule for each different level of depth. just take existing rule and add new
Code:
([^/]*)/
and additional
Code:
/<jd:source:4>
__________________
JD-Dev & Server-Admin
Reply With Quote
  #10  
Old 25.09.2022, 14:27
nicolau nicolau is offline
Baby Loader
 
Join Date: Mar 2021
Posts: 6
Default

Quote:
Originally Posted by Jiaz View Post
@nicolau: unfortunately at the moment it's not yet possible. So you have to create rule for each different level of depth. just take existing rule and add new
Code:
([^/]*)/
and additional
Code:
/<jd:source:4>
Right. Thank you very much
Reply With Quote
  #11  
Old 26.09.2022, 11:58
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 78,379
Default

@nicolau: In case you need further help/got questions, just ask
__________________
JD-Dev & Server-Admin
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 20:28.
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 - 2022, Jelsoft Enterprises Ltd.