mmcdole / gofeed

Parse RSS, Atom and JSON feeds in Go
MIT License
2.56k stars 208 forks source link

Failed to detect feed type on https://www.derstandard.at/rss/web #166

Open torlenor opened 3 years ago

torlenor commented 3 years ago

gofeed cannot detect the feed type on feed https://www.derstandard.at/rss/web

Expected behavior

Return a valid parsed feed, without error.

Actual behavior

Parsing the feed results in "Failed to detect feed type"

Steps to reproduce the behavior

Try parsing the feed

fp := gofeed.NewParser()
feed, err := fp.ParseURL("https://www.derstandard.at/rss/web")
milochristiansen commented 3 years ago

I have this exact issue. Loads of RSS 2.0 feeds are not being detected. Oddly, an old version of my RSS notifier built with some unknown older version of this library seems to work fine. Investigating.

milochristiansen commented 3 years ago

Reverting to v1.0.0-beta2 fixes my issue. I'm not wasting my time trying to figure out if that is the last version that works or not, I just know that it is a version that works.

nkanaev commented 3 years ago

the issue has been fixed in https://github.com/mmcdole/gofeed/commit/d5ae83954e0552f161c04d5d1835d20f82950916 and is on master, but hasn't been released by semver (cc: @mmcdole v1.1.1 maybe?).

that said, the safest approach would be to not assume the input to be utf-8 all the time, and pass a reader that's capable of handling bom encodings & various charsets instead (for ex.: golang.org/x/net/hmtl/charset.NewReader & dimchansky/utfbom)