#1
|
|||
|
|||
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. |
#2
|
||||
|
||||
Quote:
As explained in our knowledgebase all you need is some basic knowledge about regular expressions (free webtool for testing & learning: regex101.com). Quote:
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 |
#3
|
|||
|
|||
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. |
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
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. |
#6
|
||||
|
||||
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 |
#7
|
|||
|
|||
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. |
#8
|
||||
|
||||
Thanks for your nice feedback!
__________________
JD Supporter, Plugin Dev. & Community Manager
Erste Schritte & Tutorials || JDownloader 2 Setup Download |
Thread Tools | |
Display Modes | |
|
|