Generate root-level opml.xml listing all channel feeds #11

Closed
opened 2026-06-18 03:10:36 +00:00 by coding-agent-marvin8 · 1 comment
coding-agent-marvin8 commented 2026-06-18 03:10:36 +00:00 (Migrated from codeberg.org)

When sub2pod processes a parent directory containing multiple channel subdirectories, there is currently no way for a podcast client to discover all feeds at once. An OPML index file at the root level would let users import the entire collection in a single step.

The tool should write an opml.xml file into the parent directory listing each channel's feed URL and title.

When sub2pod processes a parent directory containing multiple channel subdirectories, there is currently no way for a podcast client to discover all feeds at once. An OPML index file at the root level would let users import the entire collection in a single step. The tool should write an opml.xml file into the parent directory listing each channel's feed URL and title.
coding-agent-marvin8 commented 2026-06-18 03:11:09 +00:00 (Migrated from codeberg.org)

Exploration findings

The CLI in src/sub2pod/cli.py already walks parent_dir, collects channel dirs with a tvshow.nfo, parses each one with parse_channel_nfo(), discovers episodes, and writes feed.xml. All the data needed for OPML (channel title + channel dir name for the URL) is available in that loop.

Plan of attack

  1. New module src/sub2pod/opml.pybuild_opml_xml(channels, base_url) -> bytes and write_opml(parent_dir, channels, base_url) -> Path, using lxml.etree (no namespace, OPML 2.0). Feed URL per channel: {base_url}/{quote(channel_dir.name)}/feed.xml.
  2. Update src/sub2pod/cli.py — accumulate (channel_info, channel_dir) pairs, then after the loop write or dry-print opml.xml.
  3. New test file tests/test_opml.py — TDD (failing tests first): XML structure, percent-encoding, CLI integration (opml.xml created alongside feed.xml files, dry-run prints path without writing).
  4. Mark ROADMAP.md item done in the same commit as the implementation.
**Exploration findings** The CLI in `src/sub2pod/cli.py` already walks `parent_dir`, collects channel dirs with a `tvshow.nfo`, parses each one with `parse_channel_nfo()`, discovers episodes, and writes `feed.xml`. All the data needed for OPML (channel title + channel dir name for the URL) is available in that loop. **Plan of attack** 1. New module `src/sub2pod/opml.py` — `build_opml_xml(channels, base_url) -> bytes` and `write_opml(parent_dir, channels, base_url) -> Path`, using `lxml.etree` (no namespace, OPML 2.0). Feed URL per channel: `{base_url}/{quote(channel_dir.name)}/feed.xml`. 2. Update `src/sub2pod/cli.py` — accumulate `(channel_info, channel_dir)` pairs, then after the loop write or dry-print `opml.xml`. 3. New test file `tests/test_opml.py` — TDD (failing tests first): XML structure, percent-encoding, CLI integration (opml.xml created alongside feed.xml files, dry-run prints path without writing). 4. Mark ROADMAP.md item done in the same commit as the implementation.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
marvin8/sub2pod#11
No description provided.