Step 3: feed fetch and parse

Conditional GET plus an RSS-first, Atom-fallback parser normalising both
into one entry model, with iTunes explicit and ttl handling carried over
from the Python. Enclosures are recorded as pending; nothing downloads yet.

GUID falls back guid -> link -> enclosure url -> title rather than hashing
the description as the original did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RPyeapneuXrCdojsaiXGbe
This commit is contained in:
2026-09-09 20:34:09 +00:00
parent a13f19136c
commit ab2583fc64
6 changed files with 663 additions and 15 deletions

18
tests/data/atom.xml Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Atom Cast</title>
<link rel="alternate" href="https://example.org/"/>
<updated>2004-02-29T01:00:00Z</updated>
<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
<entry>
<title>Atom Episode One</title>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2004-02-29T01:00:00Z</updated>
<published>2004-02-29T01:00:00Z</published>
<link rel="alternate" href="https://example.org/ep/1"/>
<link rel="enclosure" type="audio/mp4" length="9876543" href="https://example.org/ep1.m4a"/>
<summary>An Atom entry carrying an enclosure link.</summary>
<category term="Tech"/>
</entry>
</feed>