From d10bfa9065bf03eeafdd5e40025f06922bcb5bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Sat, 29 Jun 2024 17:38:57 +0200 Subject: [PATCH] [vipergirls] improve 'thread' URL pattern allow for query parameters and fragments at tne end of URLs --- gallery_dl/extractor/vipergirls.py | 3 ++- test/results/vipergirls.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gallery_dl/extractor/vipergirls.py b/gallery_dl/extractor/vipergirls.py index 6dfb23cc..5cde0d6c 100644 --- a/gallery_dl/extractor/vipergirls.py +++ b/gallery_dl/extractor/vipergirls.py @@ -101,7 +101,8 @@ class VipergirlsExtractor(Extractor): class VipergirlsThreadExtractor(VipergirlsExtractor): """Extractor for vipergirls threads""" subcategory = "thread" - pattern = BASE_PATTERN + r"/threads/(\d+)(?:-[^/?#]+)?(/page\d+)?$" + pattern = (BASE_PATTERN + + r"/threads/(\d+)(?:-[^/?#]+)?(/page\d+)?(?:$|#|\?(?!p=))") example = "https://vipergirls.to/threads/12345-TITLE" def __init__(self, match): diff --git a/test/results/vipergirls.py b/test/results/vipergirls.py index 7f0910d1..cd6adac0 100644 --- a/test/results/vipergirls.py +++ b/test/results/vipergirls.py @@ -23,6 +23,18 @@ __tests__ = ( "#count" : 1279, }, +{ + "#url" : "https://vipergirls.to/threads/4328304-2011-05-28-Danica-Simply-Beautiful-x112-4500x3000?highlight=foobar", + "#category": ("", "vipergirls", "thread"), + "#class" : vipergirls.VipergirlsThreadExtractor, +}, + +{ + "#url" : "https://vipergirls.to/threads/4328304?foo=bar", + "#category": ("", "vipergirls", "thread"), + "#class" : vipergirls.VipergirlsThreadExtractor, +}, + { "#url" : "https://vipergirls.to/threads/4328304", "#category": ("", "vipergirls", "thread"),