This commit is contained in:
felinae98 2022-06-08 23:08:20 +08:00
parent 9c1f29aaad
commit 4ec81468b7
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -48,6 +48,10 @@ class Rss(NewMessage):
soup = bs(raw_post.description, "html.parser")
text += soup.text.strip()
pics = list(map(lambda x: x.attrs["src"], soup("img")))
if raw_post.get("media_content"):
for media in raw_post["media_content"]:
if media.get("medium") == "image" and media.get("url"):
pics.append(media.get("url"))
return Post(
"rss",
text=text,