[bellazon] support video embeds (#8239)

This commit is contained in:
Mike Fährmann
2025-09-20 11:06:59 +02:00
parent 0abee97543
commit dbae953c71
2 changed files with 14 additions and 1 deletions

View File

@@ -24,8 +24,10 @@ class BellazonExtractor(Extractor):
archive_fmt = "{post[id]}/{filename}"
def items(self):
extract_urls = text.re(r'<a ([^>]*?href="([^"]+)".*?)</a>').findall
native = (f"{self.root}/", f"{self.root[6:]}/")
extract_urls = text.re(
r'(?s)<((?:video .*?<source src|a [^>]*?href)="([^"]+).*?)</a>'
).findall
for post in self.posts():
urls = extract_urls(post["content"])

View File

@@ -179,6 +179,17 @@ __tests__ = (
),
},
{
"#url" : "https://www.bellazon.com/main/topic/66334-charly-jordan/page/31/#comment-5317926",
"#comment" : "video embed (#8239)",
"#class" : bellazon.BellazonPostExtractor,
"#results" : "https://www.bellazon.com/main/uploads/monthly_2021_07/215731864_146910617534875_8340126104113274819_n.mp4.2f3cd5cd8cac6bf04c51d511892f187b.mp4",
"extension": "mp4",
"filename" : "215731864_146910617534875_8340126104113274819_n.mp4.2f3cd5cd8cac6bf04c51d511892f187b",
"id" : "10919171",
},
{
"#url" : "https://www.bellazon.com/main/topic/57872-millie-brady/",
"#class" : bellazon.BellazonThreadExtractor,