fix for "test_unique_pattern_matches"

This commit is contained in:
enduser420
2022-06-27 18:29:11 +05:30
parent f1d15e2aa3
commit 853435f437

View File

@@ -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)