feat: add external site parser worker

This commit is contained in:
Your Name
2026-08-10 20:48:23 +05:00
parent fbc1e3fd1b
commit 3dea6f43f3
14 changed files with 690 additions and 44 deletions
+16
View File
@@ -0,0 +1,16 @@
from app import parse_rss
def test_parse_rss() -> None:
xml = """<rss><channel><item><guid>1</guid><title>Title</title>
<link>https://example.test/1</link>
<description>&lt;p&gt;Body&lt;/p&gt;&lt;img src="https://example.test/1.jpg"&gt;</description>
<pubDate>Mon, 10 Aug 2026 10:00:00 +0000</pubDate></item></channel></rss>"""
item = parse_rss(xml, 20)[0]
assert item.external_id == "1"
assert item.text == "Body"
assert item.media[0]["url"] == "https://example.test/1.jpg"
if __name__ == "__main__":
test_parse_rss()