[xenforo] fix incomplete video URLs (#8786)

This commit is contained in:
Mike Fährmann
2025-12-31 10:48:51 +01:00
parent 2a629fd653
commit 9ff3cc4a8e
2 changed files with 13 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ class XenforoExtractor(BaseExtractor):
r')'
).findall
root_media = self.config_instance("root-media") or self.root
for post in self.posts():
urls = extract_urls(post["content"])
if post["attachments"]:
@@ -74,6 +75,8 @@ class XenforoExtractor(BaseExtractor):
text.nameext_from_url(url, data)
data["id"] = text.parse_int(
data["filename"].partition("-")[0])
if url[0] == "/":
url = root_media + url
yield Message.Url, url, data
elif (inline := inl1 or inl2):
@@ -274,6 +277,7 @@ BASE_PATTERN = XenforoExtractor.update({
},
"atfforum": {
"root": "https://allthefallen.moe/forum",
"root-media": "https://allthefallen.moe",
"pattern": r"(?:www\.)?allthefallen\.moe/forum",
"cookies": ("xf_user",),
},

View File

@@ -58,6 +58,15 @@ __tests__ = (
"#class" : xenforo.XenforoPostExtractor,
},
{
"#url" : "https://www.allthefallen.moe/forum/index.php?threads/shoujo-ramune-episode-1-decensored-by-deepcreampy.17050/#post-19803487",
"#comment" : "incomplete video URL (#8786)",
"#category": ("xenforo", "atfforum", "post"),
"#class" : xenforo.XenforoPostExtractor,
"#auth" : True,
"#results" : "https://allthefallen.moe/forum/data/video/1094/1094367-e46ad8636dee0d4488db56d3770919cc.mp4",
},
{
"#url" : "https://www.allthefallen.moe/forum/index.php?threads/final-fantasy-xiv.57090/",
"#category": ("xenforo", "atfforum", "thread"),