fossar / selfoss

multipurpose rss reader, live stream, mashup, aggregation web application
https://selfoss.aditu.de
GNU General Public License v3.0
2.35k stars 343 forks source link

OPML import failed #1475

Open 20NE opened 6 months ago

20NE commented 6 months ago

selfoss 2.19

OPML file that exported from miniflux, import failed with debug error: Invalid type '': only 'rss' and 'atom' are supported

miniflux opml file like:

<?xml version="1.0" encoding="UTF-8"?>
<opml version="2.0">
    <head>
        <title>Miniflux</title>
        <dateCreated>Wed, 20 Dec 2023 10:28:26 CST</dateCreated>
    </head>
    <body>
        <outline text="All">
            <outline title="http://feeds.feedburner.com/felixcat" text="http://feeds.feedburner.com/felixcat" xmlUrl="http://feeds.feedburner.com/felixcat" htmlUrl="http://feeds.feedburner.com/felixcat"></outline>
            <outline title="https://www.archlinux.org/feeds/news/" text="https://www.archlinux.org/feeds/news/" xmlUrl="https://archlinux.org/feeds/news/" htmlUrl="https://www.archlinux.org/feeds/news/"></outline>
        </outline>
    </body>
</opml>
jtojnar commented 6 months ago

Thanks for reporting. According to the OPML specification, the outline element should contain type="rss" attribute so this is a miniflux bug.

I guess we could consider as feeds even outlines without type attribute, as long as they have xmlUrl. That will allow us to support even applications producing invalid OPML files like this. Though that might cause conflicts if extensions not declared in the main spec also use xmlUrl and the application also omits type. But that is probably rare as, these days, OPML is used for little else than feed exports, and people will usually try to import exports from other feed reader rather than random OPML they find online.

jtojnar commented 6 months ago

I have opened a PR fixing it in miniflux https://github.com/miniflux/v2/pull/2267