diff --git a/gallery_dl/extractor/rule34us.py b/gallery_dl/extractor/rule34us.py index cd6e8b3b..d48539e2 100644 --- a/gallery_dl/extractor/rule34us.py +++ b/gallery_dl/extractor/rule34us.py @@ -57,7 +57,7 @@ class Rule34usTagExtractor(Rule34usExtractor): subcategory = "tag" directory_fmt = ("{category}", "{search_tags}") archive_fmt = "t_{search_tags}_{id}" - pattern = r"(?:https?://)?rule34\.us/index\.php\?r=posts/index&q=([^&#]+)" + pattern = r"(?:https?://)?rule34\.us/index\.php\?r=posts/index&q=([^&#]*)" example = "https://rule34.us/index.php?r=posts/index&q=TAG" def __init__(self, match): diff --git a/test/results/rule34us.py b/test/results/rule34us.py index 5f4f26c4..1f834bd1 100644 --- a/test/results/rule34us.py +++ b/test/results/rule34us.py @@ -14,6 +14,15 @@ __tests__ = ( "#class" : rule34us.Rule34usTagExtractor, "#pattern" : r"https://img\d*\.rule34\.us/images/../../[0-9a-f]{32}\.\w+", "#count" : 10, + + "search_tags": "[terios]_elysion", +}, + +{ + "#url" : "https://rule34.us/index.php?r=posts/index&q=", + "#comment" : "empty 'q' query parameter (#8546)", + "#category": ("booru", "rule34us", "tag"), + "#class" : rule34us.Rule34usTagExtractor, }, {