JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 13.07.2017, 19:42
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default Please help me with packagiser regex rule.

So.. long time JD user here, never really got behind the packagizer. I tried some prolly stupid as hell regex stuff i threw together which didnt work as intended at all but i guess if you know your way around both of those monsters its gotta be easy.

I just want my tv shows to get downloaded/extracted/moved into the right show folder. All shows have "SXXEXX" (example: s07e01) in their file and package name. Since i cant packagize like a big boy im using the kiddo version which works but well.. i have to create one for every single damn show:

you get the idea.

can somebody please be so kind and explain me what i need todo so i can stop creating endless rules and folders by hand? :|

Last edited by sucr4m; 13.07.2017 at 22:36.
Reply With Quote
  #2  
Old 13.07.2017, 20:17
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

you need to tell it how many times to repeat
\d for instance will only pick up 0-9 it wont pick up 00-99+
if you expect at least one or more its \d+
if you expect it for specific character count its \d{countvalue}
for instance \d{2} = 00-99
for instance \d{1,2} = 0-99

for more assistance try _**External links are only visible to Support Staff** place in what you want to match it should highlight as you write your pattern
__________________
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 13.07.2017, 21:48
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 64,029
Default

Your example matches on
s\d+e\d+
and don't forget to enable the regex checkbox
__________________
JD-Dev & Server-Admin
Reply With Quote
  #4  
Old 13.07.2017, 22:35
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

its not the match that wasnt working, its everything after that.

I have no idea how to tell it to create -> move it to a folder with the Show name without the SxxExx.xxxxx.xxx.xxxxp.xxx.xx following. It needs to be cut off from the folder. So that in the end my

"Show.name.S02E01.1080p.hsomething.grp" goes into

"x:\tvshows\Show name"

I dont know if its even possible im just assuming there is a way to identify the spot right before the "SxxExx" and cut it.
Reply With Quote
  #5  
Old 14.07.2017, 02:59
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

you will need to use regex
put a listen range () before S\d+E\d+
use dynamic tag (select it via right click function)
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #6  
Old 14.07.2017, 11:29
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Quote:
Originally Posted by raztoki View Post
you will need to use regex
put a listen range () before S\d+E\d+
use dynamic tag (select it via right click function)
so i tried this which at least in the right click -> test package name expression matches and the wildcard picks up everything up to "**External links are only visible to Support Staff** which does seem to cut off the SxxExx but when i actually try it the link grabber just does his thing for files that dont match any rule.

i mean cant you PLEASE just finish this and explain by example? This is far from solved as it is :|

Last edited by sucr4m; 14.07.2017 at 11:37.
Reply With Quote
  #7  
Old 14.07.2017, 11:57
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

package names should not start with /, as we typically strip chars
are you wanting to parse our provided package names or are you wanting to do via returned filename. I would say packagename is the correct way because it will mean _ and . are stripped and you wont have duplicate directories on harddrive (as in series.name and series_name for instance).

rule name: "generic tv"
package name: equals; "(.+)S\d+E\d+.+"; regex checkbox
then set...
Download Directory; "somepath\<jd:orgpackagename:1>"

done

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #8  
Old 14.07.2017, 12:23
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Quote:
Originally Posted by raztoki View Post
rule name: "generic tv"
package name: equals; "(.+)S\d+E\d+.+"; regex checkbox
then set...
Download Directory; "somepath\<jd:orgpackagename:1>"

done

raztoki
Package name sure seems the way to go, even though now it does the same thing with (.+)S\d+E\d+.+ as it did with (/.*)S\d+E\d+ and its being ingored by the link grabber which puts it in the default location with the full name. I even tried to put the rull as the first one to execute, still the same.

Controll pic so you can see i did what you said.
Reply With Quote
  #9  
Old 14.07.2017, 12:49
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

works fine with the test links I added. I didn't use contains though I used equals.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #10  
Old 14.07.2017, 13:26
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Okay.. so i did some testing in the wild and from what i can say this works.

IF i:
1 disable the predifined subfolder by packagename rule
+
2 put the regex "(.+)S\d+E\d+.+" on the filename instead of the package name

Which is strange because all my other rules for single tvshows work with 1 BUT i indeed do use the filename in my other rules aswell.

Funny enough even though the file names clearly go by "show.name" with the dot inbetween it replaces the dot with a space. im an idiot. I tested that with a show that had a rule on its own. It indeed puts the dot from the file name into the folder name.

Even with the rule turned off it still puts files that arent tvshows in folders going by the package name.. or well.. the file name without dots.


Soo, of course, it didnt put the files in their own subfolder. Why would i even think that with the rule disabled.
The question is then, why do i need to disable the rule for the generic tvshow rule to work while the other single tv show rules work either way.


D:

okay. I put the rule at the end of the list again re-enabled the subfolder rule.. and now it "works". Needing to have the regex in the file name instead of the package name does put dots in the folder name which is kind of a nogo. Is there a way to read out/see the package name? Or rather, what exactly IS the package name? Im so confused right now.

Last edited by sucr4m; 14.07.2017 at 14:28.
Reply With Quote
  #11  
Old 14.07.2017, 14:16
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

it processes rules based on order in the list. another rule can over ride based on the sequence in which is processed.

no worries

raztoki
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #12  
Old 14.07.2017, 15:24
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

well i tried putting the generic tv rule before and after the predifined subfolder by packagename rule, both ways wont work with the regex in the package name. It does work if i disable the subfolder rule. But then i dont get subfolders for every file that isnt a tvshow..


prolly i misstook it with another show that already had a single rule, thats what i get for working and trying to fix my home stuff at once.

so in the end no matter what i do it wont work over package name. Even if i type in the exact show name it wouldnt match the package name, as if i dont even have one. But that cant be either because then the subfolder rule wouldnt work.

Maybe ill try it with a fresh install from JD2 since it seemed to work for you and i cant see anything im doing different.

Last edited by sucr4m; 14.07.2017 at 15:54.
Reply With Quote
  #13  
Old 14.07.2017, 19:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 64,029
Default

New Installation won't help and is not the reason why it doesn't work.

The answer is simple. DON'T use packagename

You can only parse on package name if the plugin sets one! Only very few plugins set a package name. The auto package naming happens AFTER the packagizer rules!
So at the time the rule is being processed, there is no package name to work on.

The simple solution is: Use Filename
__________________
JD-Dev & Server-Admin
Reply With Quote
  #14  
Old 14.07.2017, 19:39
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Well thats good to know, thanks.

For the 'simple' solution though.. if i use the filename is there a way to get the dots and underlines out of my file/folder names? And if its not possible through the packagizer might the event scripter be able todo something like that?

Or am i doomed to keep creating rules for every single tv show im starting to watch? :'<
Reply With Quote
  #15  
Old 19.07.2017, 08:46
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 555
Default

Quote:
Originally Posted by sucr4m View Post
... if its not possible through the packagizer might the event scripter be able todo something like that? ...
You can use event scripter to remove/replace superfluous characters and also set package names.
Reply With Quote
  #16  
Old 19.07.2017, 11:10
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Please teach me, master :<
Reply With Quote
  #17  
Old 19.07.2017, 13:05
mgpai mgpai is offline
Script Master
 
Join Date: Sep 2013
Posts: 555
Default

Script -> Link
Reply With Quote
  #18  
Old 19.07.2017, 14:24
sucr4m sucr4m is offline
Vacuum Cleaner
 
Join Date: Jul 2017
Posts: 15
Default

Quote:
Originally Posted by mgpai View Post
Script -> **External links are only visible to Support Staff**...
First i thought it wouldnt work but when i went through the script for the 100th time i actually understood i need to put the packagename back into the download directory instead of <jd:orgfilename:1>.

You are actually creating the package name instead of JD if a match is given it right? Thats way better than trying to have the folder renamed AFTER the download.. which was what i was thinking off.

Well thank you very much kind stranger.

One more question: if i would ever encounter something else in the filename like lets say a "-" or w/e i would just need to add it inside "[._]" right? Something like "[._-]" ? Or would it need some kind of divider?

edit: or even a "US" or "2017". Its okay to just add it to be replaced by a space since folder names cant have spaces at the end. I just tried [._US] which worked for the example link i dug out but logic tells me adding a 2017 behind that wouldnt work. Maybe [2017._US] would do, i just dont have a link with 2017 after the show name and before the SxxExx right now. D:

Its really damn rare but it comes up from time to time

Last edited by sucr4m; 19.07.2017 at 14:41.
Reply With Quote
  #19  
Old 15.07.2017, 02:41
raztoki's Avatar
raztoki raztoki is offline
English Supporter
 
Join Date: Apr 2010
Location: Australia
Posts: 16,146
Default

ohhh I did forget about that, sorry.
__________________
raztoki @ jDownloader reporter/developer
http://svn.jdownloader.org/users/170

Don't fight the system, use it to your advantage. :]
Reply With Quote
  #20  
Old 17.07.2017, 19:02
Jiaz's Avatar
Jiaz Jiaz is offline
JD Manager
 
Join Date: Mar 2009
Location: Germany
Posts: 64,029
Default

Please provide some example links, then we can help better if we know what exactly you mean
__________________
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 01:12.
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 - 2019, Jelsoft Enterprises Ltd.