Am I using contains with --filter incorrectly? #6065
-
#2446 I saw this because I was trying to us any() but this suggested I use contains(). I get prints like This however works? and so does: gallery-dl --filter "'season 3' not in title.lower() and 'season 1' not in title.lower()" --simulate --filename "{title}.{extension}" https://www.webtoons.com/en/fantasy/tower-of-god/list?title_no=95 I saw that contains() was added and I would like it because bc then i can simply create one list to exclude instead of writing not in this and not in that and not in thisthat, etc etc. These are simplified examples for testing cause I add some more complexity, but they've been tested. I really liked the idea of contains cause itwould make my config shorter and more legible. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
not any(t in title.lower() for t in ('season 3', 'season 1'))
re.search(r'(?i)season [13]', title) |
Beta Was this translation helpful? Give feedback.
regex solution works!
any/all solution does not (or more likely I am misunderstanding something)!
I realize why contains would not work as I found its method signature in util.py
The any/all solution was actually my starting point and the reason I found #2446 which I thought was suggesting to use contains, as somehow title wouldn't resolve correctly using any/all which may still be the case?
gallery-dl --filter "not any(t in title.lower() for t in ('season 3', 'season 1'))" --simulate --filename "{title}.{extension}" https://www.webtoons.com/en/fantasy/tower-of-god/list?title_no=95
returns nothing
gallery-dl --filter "any(t in title.lower() for t in ('season 3', 'season 1'))" --simulate -…