JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 26.05.2020, 05:32
Ryonez Ryonez is offline
Modem User
 
Join Date: May 2020
Posts: 3
Lightbulb Feature Request: RegEx Shortcut for <jd:plugin> for Packizer

Hi there!

I'd like to request a new dynamic variable for the packagizer that will return the plugin that was used in the download.

Example use case:



This way if I download a video from youtube, it'll end up with a file/folder name starting with "youtube.com--".

Another variable that stripes the `.com` would be great, as I'm really only after the site/service name.
Reply With Quote
  #2  
Old 26.05.2020, 08:19
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 17,110
Default

would it be easier to use existing feature like downloadurl/sourceurl then match the domain in regex without the .com? then reference it with respective dynamic tag ?

the issue with your request, is the package customiser doesn't have reference to which plugin gets used for download. linkchecking/adding of links can be done via decrypter or hoster plugins. Also different plugin can download in respects to multihoster plugins (though not for youtube in this case).
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #3  
Old 26.05.2020, 09:08
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 67,320
Default

Raztoki is right that the plugin might not being known yet. The packagizer rules are processed at different stages.
Also there might be several main domains for a site/service, so which one to use? With/without tld....

You should just use regex to parse/check on url and then assign the tag by yourself. That way you know exactly what it does/how it works/works as you expect it to work
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 26.05.2020, 09:35
Ryonez Ryonez is offline
Modem User
 
Join Date: May 2020
Posts: 3
Default

Alright, I've given that a go and it works. This method certainly has a disadvantage with needing you to make a rule for every site you want to do this with.

But I do see the issue the other way if it delves in a link and pulls lots of other links.

Thank you for the help, it got me where I wanted to be.
Reply With Quote
  #5  
Old 26.05.2020, 10:31
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 67,320
Default

You can also create a rule that parses the domain from URL and then use that match somewhere else.
You can use matching groups in the *set* fields. That way you could create a generic solution for this
When you need help/got question, just ask
__________________
JD-Dev & Server-Admin
Reply With Quote
  #6  
Old 26.05.2020, 15:59
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 898
Default

Quote:
Originally Posted by Ryonez View Post
... dynamic variable for the packagizer that will return the plugin that was used in the download...
Quote:
Originally Posted by Jiaz View Post
... <jd:hoster:number> this placeholder will be replaced by the matching group(number) of downloadurl pattern or the host itself if number is -1 ...
While you can use <jd:hoster:-1> in packagizer to get the host name, it will break auto package name generation. This will also return only the plugin name in some cases (e.g. http links).

A better option would be to use "Split Packages By Hoster" option in the context menu. Unlike packagizer rule, you can use this to append the host name only to the selected packages. Also, it will return the actual host name even for direct http links.

By default it will create a package name in 'packagename - hostname' format. But you can invert the pattern in advanced settings (LinkgrabberSettings.splitpackagenamefactorypattern).
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 19:07.
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.