[xenforo] support '/#post-ID' URLs

This commit is contained in:
Mike Fährmann
2025-12-31 10:43:53 +01:00
parent 239de3f092
commit 2a629fd653
2 changed files with 7 additions and 1 deletions

View File

@@ -283,7 +283,7 @@ BASE_PATTERN = XenforoExtractor.update({
class XenforoPostExtractor(XenforoExtractor):
subcategory = "post"
pattern = (BASE_PATTERN + r"(/(?:index\.php\?)?threads"
r"/[^/?#]+/post-|/posts/)(\d+)")
r"/[^/?#]+/#?post-|/posts/)(\d+)")
example = "https://simpcity.cr/threads/TITLE.12345/post-54321"
def posts(self):

View File

@@ -52,6 +52,12 @@ __tests__ = (
},
},
{
"#url" : "https://www.allthefallen.moe/forum/index.php?threads/final-fantasy-xiv.57090/#post-21765744",
"#category": ("xenforo", "atfforum", "post"),
"#class" : xenforo.XenforoPostExtractor,
},
{
"#url" : "https://www.allthefallen.moe/forum/index.php?threads/final-fantasy-xiv.57090/",
"#category": ("xenforo", "atfforum", "thread"),