Page 1 of 1

Unknown/unsupported feed type error

Posted: 17 May 2013, 19:42
by reibuehl
Hi,

for a few of my feeds I get the error "Unknown/unsupported feed type" even though the feed is apparently a regular RSS feed and also works in Google Reader.

http://www.instructables.com/tag/type-i ... gy/rss.xml is one of the feeds that doesn't work.

Is there anything I can do to prevent this?

Reiner.

Re: Unknown/unsupported feed type error

Posted: 17 May 2013, 19:53
by fox
[15:49:14/26422] error fetching feed: LibXML error 9 at line 372 (column 57): Input is not proper UTF-8, indicate encoding !
Bytes: 0xA0 0x28 0x69 0x50

Re: Unknown/unsupported feed type error

Posted: 17 May 2013, 20:06
by reibuehl
Does this mean that the feed has a different encoding type than what is specified in the feed itself?

As I have no influence on the content of the feed, is there a way to enforce another encoding?

Re: Unknown/unsupported feed type error

Posted: 17 May 2013, 20:11
by fox
The feed does not specify encoding. For XML this means unicode. Which it isn't.

As much as I detest GIGO shit, this shouldn't really break anything, and might help:

https://github.com/gothfox/Tiny-Tiny-RS ... afd0316be3

Encoding guessing of some kind might be added later.

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 13:45
by reibuehl
I implemented the change you suggested and this solved the problem for one of my feeds. The other one seems to be a bit trickier though: I found out that for whatever reason the site returns different content based on the user-agent string of the requesting client. If I request the URL with tt-rss or wget, I do not a RSS feed but a few redirects and finally an XHTML page. If I try the same with Firefox or wget with a Firefox user-agent string, I get a proper RSS XML!

Is it possible to change the user-agent string to circumvent this? The URL that shows this behavior is http://xyya.net/auto/rss.xml

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 13:52
by fox
You can change it globally which will automatically disqualify you from any further support and break many other feeds. Per feed agent changing will not happen for obvious reasons.

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 14:51
by feader
fox wrote:Per feed agent changing will not happen for obvious reasons.

@reibuehl
You can do this in a plugin. I'm creating one at the moment which may provide a frame for this, but the hard part (code the php that fetches the feed with a given user agent string) you must do yourself :wink:

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 15:08
by reibuehl
Would it be possible to use a proxy for tt-rss that could then take care of this?

@feader:
Sounds interesting. Do you have already some information on how your plugin will work / what interface it will provide?

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 15:22
by feader
reibuehl wrote:@feader:
Sounds interesting. Do you have already some information on how your plugin will work / what interface it will provide?

Yeah. Basically all I could do for you is the handling of a JSON file, and even that not very well :mrgreen: you had to do the hard part (coding the fetch) on your own and put it into the plugin, so I wouldn't blame you if you created your own plugin.
What I have in mind is that you provide a JSON entry

Code: Select all

"match_URL": {
"type" : "fetch",
"user_agent" : "Firefox"
}

where match_URL is a regular expression that must match against the feed URL, and the user_agent string would be the one you want to use. If you need additional data, you could of course provide that in the object.
You would have to write the code that fetches the stuff, and put it into my plugin (which is unpublished yet) with a

Code: Select all

switch($type){
[…]
case "fetch":
[your own code that fetches the stuff]
[…]
}
}

If you won't wait for me (wouldn't blame you since I hardly provide any worthwhile functionality): You just need to hook into HOOK_FEED_FETCHED.

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 15:24
by fox
I think it would be better to add a separate hook to provide custom fetching instead of internal tt-rss mechanism, using feed_fetched might cause 2x the network traffic.

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 15:27
by fox

Re: Unknown/unsupported feed type error

Posted: 20 May 2013, 16:19
by feader
This is how it's done here: Shock fox sufficiently so that he provides a better solution :D

@reibuehl
If I modified my plugin slightly, you could still hook in, now at another place, but maybe a new plugin would be better. If you would go along with me, at least I could justify the pompous name that I have in mind for my plugin :mrgreen:

But on a second thought, if you can't get the content provider to fix their stuff, you might use the af_feedmod plugin, if Tiny Tiny RSS can at least get URLs out of this shitty feed.