View Single Post
  #1  
Old 26.07.2020, 17:31
ominus ominus is offline
JD Alpha
 
Join Date: Jun 2012
Posts: 22
Default Dynamic Variable doesn't work when Regular Expressions are enabled

Hello.
I want to create two package rules for Artstation, one for the full galleries and one for the direct links to single photos.

the url for the albums has the pattern:
artstation.com/account_name/*

and the url for the direct photos, regardless of the account name, has the pattern:
artstation.com/artwork/*

I need to distinguish the two package rules based on the above patterns.
for the first rule, I used
SourceUrl Contains artstation\.com/(?!artwork) with regex enabled

the regex works fine BUT the <jd:source:1> dynamic variable doesnt work at all when regex is enabled. it doesnt appear in the right click context menu with the dynamic variables, and even if I type it in the Download Directory input field, it just becomes the raw text of the variable's name which gives me a directory error when I start downloading the album.

I need the <jd:source:1> variable because it gives me the account_name of the album, which I use as the main folder's name where I download the albums (many accounts have multiple albums).

So I am stuck here and I dont know how to fix it.

I found this topic which shows that <jd:source:1> does work, even when regex is enabled as shown in the screenshot in the link. So I dont understand what I am doing wrong.

https://board.jdownloader.org/showpo...56&postcount=9

UPDATE:

ok, I found the solution, all I needed was to add (.+) which is what enables the source dynamic variable listener when you use regular expressions.

so the first rule becomes
SourceUrl Contains artstation\.com/(?!artwork)(.+) with regex enabled

and now I can get the account name.

This is explained in this topic:
https://board.jdownloader.org/showthread.php?t=39214

Last edited by ominus; 26.07.2020 at 18:18.
Reply With Quote