From 853435f4379c0b516c26c8715603f818da995da1 Mon Sep 17 00:00:00 2001 From: enduser420 Date: Mon, 27 Jun 2022 18:29:11 +0530 Subject: [PATCH] fix for "test_unique_pattern_matches" --- gallery_dl/extractor/2chen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gallery_dl/extractor/2chen.py b/gallery_dl/extractor/2chen.py index 4b5c99de..f7cdb93a 100644 --- a/gallery_dl/extractor/2chen.py +++ b/gallery_dl/extractor/2chen.py @@ -65,18 +65,21 @@ class _2chenBoardExtractor(Extractor): """Extractor for 2chen boards""" category = "2chen" subcategory = "board" - pattern = r"(?:https?://)?2chen\.moe/([^/?#]+)(?:catalog)?" + pattern = r"(?:https?://)?2chen\.moe/([^/?#]+)/?(?:catalog)?$" test = ( ("https://2chen.moe/co/", { "pattern": _2chenThreadExtractor.pattern }), + ("https://2chen.moe/co", { + "pattern": _2chenThreadExtractor.pattern + }), ("https://2chen.moe/co/catalog", { "pattern": _2chenThreadExtractor.pattern })) def __init__(self, match): Extractor.__init__(self, match) - self.board = match.group(1) + self.board = match.group() def items(self): url = "https://2chen.moe/{}/catalog".format(self.board)