[simpcity] extract 'reddit' media embeds (#8994)

This commit is contained in:
Mike Fährmann
2026-02-04 11:50:07 +01:00
parent 9379397eec
commit 9958678af1
2 changed files with 13 additions and 2 deletions

View File

@@ -362,9 +362,11 @@ class XenforoExtractor(BaseExtractor):
continue
type = data.get("data-s9e-mediaembed")
frag = src[src.find("#")+1:]
if type == "tiktok":
url = ("https://www.tiktok.com/@/video/" +
src[src.rfind("#")+1:])
url = "https://www.tiktok.com/@/video/" + frag
elif type == "reddit":
url = "https://embed.reddit.com/r/" + frag
else:
self.log.warning("%s: Unsupported media embed type '%s'",
post["id"], type)

View File

@@ -249,6 +249,15 @@ __tests__ = (
"#results" : "https://www.tiktok.com/@/video/7556556034794425631",
},
{
"#url" : "https://simpcity.cr/threads/alrightsierra.70601/post-571509",
"#comment" : "reddit s9e media embed iframe (#8996)",
"#category": ("xenforo", "simpcity", "post"),
"#class" : xenforo.XenforoPostExtractor,
"#auth" : True,
"#results" : "https://embed.reddit.com/r/TikTokFeet/comments/rtzwnz#theme=auto",
},
{
"#url" : "https://simpcity.cr/threads/alua-tatakai.89490/",
"#category": ("xenforo", "simpcity", "thread"),