JDownloader Community - Appwork GmbH
 

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 23.05.2023, 19:10
Alhague Alhague is offline
Vacuum Cleaner
 
Join Date: Jan 2018
Posts: 16
Default how to have the host name as package name

Right guys what I'm trying to do is have the site address (URL) as the package (and subfolder) name. Basically host name as package name, if I'm correct. These folders would be within my base download directory. I'd like this to be an universal rule, not just for specific sites. I'm sure this is possible somehow? Surely others have thought of this and done this already.

So for example, if I got stuff from say:

**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**
https://imgur.com/
**External links are only visible to Support Staff****External links are only visible to Support Staff**
**External links are only visible to Support Staff****External links are only visible to Support Staff**

The resulting directory structure would look like this on my disk:

d:\downloads\JD\youtube.com\ ...
d:\downloads\JD\soundcloud.com\ ...
d:\downloads\JD\csdb.dk\ ...
d:\downloads\JD\imgur.com\ ...
d:\downloads\JD\dfiles.eu\ ...
d:\downloads\JD\rapidgator.net\ ...

I spent hours yesterday trying to get this to work. After some vigorous forum searching, I've got to the point when I realised I probably need the packagizer for this?

So I went ahead and tried what I could come up with based on my non-existent coding knowledge.

My rule went like this:

condition name: host name as package
downloadurl: contains: *
package name: <jd:hoster:1>

Which didn't seem to do anything. I've experimented with several other field entries and variations, but I can't seem to be able to make it work. Keep in mind that I didn't really know what I was doing. I'm sure it's something simple though.

As a side note, I have the default "create subfolder by packagename" rule enabled, which works wonderfully. I also set its threshold to 1, so there are no folders for single child packages. I'd like to keep this rule on as well, so I guess the other one I'm trying to work out would go above this? And then within the generated site name directories, would go the subfolders from the package names (if they contain more than 1 file, otherwise just the file).

This would greatly improve the levels of organisation of folders and files on my disk.

I'd really appreciate if someone could kindly offer some assistance with this, and tell me how exactly I need to set up that rule and what I need to enter into the specific fields.

Thanks heaps if anyone could help.
Reply With Quote
  #2  
Old 24.05.2023, 13:54
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Quote:
Originally Posted by Alhague View Post
So I went ahead and tried what I could come up with based on my non-existent coding knowledge.
Coding knowledge is not needed to create such rules.
As explained in our knowledgebase all you need is some basic knowledge about regular expressions (free webtool for testing & learning: regex101.com).


Quote:
Originally Posted by Alhague View Post
My rule went like this:

condition name: host name as package
downloadurl: contains: *
package name: <jd:hoster:1>
Well look like you didn't even define any action below "...then set".
You wanted to change the download path based on the host so first you need to extract the host and then include that in the download path.
Here is how I would do it:
Screenshot:

Link used for testing:
ping.online.net/50Mo.dat

Exported rule as plaintext:
Code:
[
 {"filetypeFilter":{"customs":null,"matchType":"IS","archivesEnabled":false,"audioFilesEnabled":false,"docFilesEnabled":false,"exeFilesEnabled":false,"hashEnabled":false,"imagesEnabled":false,"subFilesEnabled":false,"useRegex":false,"videoFilesEnabled":false,"enabled":false},"downloadDestination":"C:\\Users\\testuser\\Downloads\\<jd:source:1>","originFilter":{"matchType":"IS","origins":[],"enabled":false},"hosterURLFilter":{"matchType":"CONTAINS","regex":"","useRegex":false,"enabled":false},"onlineStatusFilter":{"matchType":"IS","onlineStatus":"OFFLINE","enabled":false},"chunks":-1,"created":1684925363780,"sourceURLFilter":{"matchType":"CONTAINS","regex":"https?://([^/]+)/.+","useRegex":true,"enabled":true},"conditionFilter":{"conditions":[],"matchType":"IS_TRUE","enabled":false},"testUrl":"**External links are only visible to Support Staff**,"enabled":true,"packagenameFilter":{"matchType":"CONTAINS","regex":"","useRegex":false,"enabled":false},"filenameFilter":{"matchType":"CONTAINS","regex":"","useRegex":false,"enabled":false},"name":"put host in downloadpath","matchAlwaysFilter":{"enabled":false},"pluginStatusFilter":{"matchType":"IS","pluginStatus":"PREMIUM","enabled":false},"filesizeFilter":{"from":0,"matchType":"BETWEEN","to":0,"enabled":false}}
]
__________________
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?
Reply With Quote
  #3  
Old 24.05.2023, 18:23
Alhague Alhague is offline
Vacuum Cleaner
 
Join Date: Jan 2018
Posts: 16
Default

Thanks very much for your reply and explanation, I highly appreciate it.

I did everything as you said, and there's a huge progress. But unfortunately, for me it's only working sort of.

If I put your new rule above the default "create subfolder by..." rule, the new rule has no effect, there are no folders created based on the host name.

If I put the new rule below the default "create subfolder by..." rule, then there are now folders created based on the host name, but no further subfolders inside those. Just all the files within that host name folder, even though there should be folders as there are several links that have more than 1 file in them. I tested it on YT links.

I'm assuming the other packagizer rule is not working as it should. How can I ensure that one is taken into account please?

Thanks indeed.
Reply With Quote
  #4  
Old 24.05.2023, 19:38
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Well just combine both into one new rule:

Disable pre defined rule "Create subfolder by packagename" and use this one:
__________________
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?
Reply With Quote
  #5  
Old 25.05.2023, 19:06
Alhague Alhague is offline
Vacuum Cleaner
 
Join Date: Jan 2018
Posts: 16
Default

Wonderful! Thank you so much for helping me sort this out.

I had to swap them round though, to get the desired effect.

So now the download directory filed looks like this:

<jd:source:1>/<jd:packagename>

Tremendous work from you helping me with this, I would've never worked out that regex for example.

I'm very happy with the end result, exactly what I wanted.

Another question though. Only a nitpick.

Would it be possible to cut off bits from that generated domain name that ends up being the folder?

Namely, "www." from the beginning (if it exists), and at the end, everything that comes after (and including) the last dot.

So eg. the folder "www.youtube.com" would look like "youtube" or "soundcloud.com" would end up as "soundcloud" on the disk.
Reply With Quote
  #6  
Old 30.05.2023, 17:09
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Sure that is possible: Just adjust the regular expression:
Code:
https?://(?:www\.)?([^/]+)/.+
__________________
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?
Reply With Quote
  #7  
Old 03.06.2023, 10:03
Alhague Alhague is offline
Vacuum Cleaner
 
Join Date: Jan 2018
Posts: 16
Default

That's lovely! Thank you so much, it's working beautifully.

This whole function is brilliant, helps to keep track of stuff much better.

Much appreciated.
Reply With Quote
  #8  
Old 06.06.2023, 00:55
pspzockerscene's Avatar
pspzockerscene pspzockerscene is offline
Community Manager
 
Join Date: Mar 2009
Location: Deutschland
Posts: 70,918
Default

Thanks for your nice feedback!
__________________
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?
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 17: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 - 2024, Jelsoft Enterprises Ltd.