Accept a FreshRSS "Export" .zip directly for OPML import

FreshRSS's Export feature produces a .zip (an .opml.xml plus a starred-
articles .json this app doesn't import) rather than a bare .opml file —
uploading that zip as-is failed with "That file doesn't look like a valid
OPML export" since defusedxml can't parse a zip as XML.

apps.feeds.opml.extract_opml_bytes detects a zip upload and pulls the
.opml/.opml.xml member out of it before parsing; a bare .opml upload is
returned unchanged, so existing behavior is untouched. Verified against
the reporter's actual FreshRSS export (18 feeds across 6 categories) both
directly through extract_opml_bytes/parse_opml and as a real upload
through the running app.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
ksmithandClaude Sonnet 5 committed 2026-10-30 21:45:16 -06:00
1 parent 753ae9efc7
commit f818b11041
6 files changed
+86 -4

No files matched your search

+4 -1
View File
@@ -3,7 +3,10 @@
{% block content %}
<p><a href="{% url 'feeds:subscription_list' %}">&larr; Back to subscriptions</a></p>
<h1>Import OPML</h1>
<p>Upload an OPML file exported from FreshRSS or another feed reader.</p>
<p>
Upload an OPML file, or a FreshRSS "Export" .zip — the .opml.xml inside
it is read automatically, you don't need to unzip it yourself.
</p>
<form method="post" enctype="multipart/form-data">
{% csrf_token %}
{{ form.as_p }}