XML Parsing Problem with Usenet Crawler Newznab Server

I am having this issue when I am trying to use the Newznab server API provided by Usenet Crawler. Seems like the expected token is being case sensitive? The message and exception is as below.

Any idea on how I may fix this?


Message

An error occurred while processing feed. https://www.usenet-crawler.com/rss/api?t=tvsearch&cat=5030,5040&extended=1&apikey=<removed>&offset=0&limit=100: 'doctype' is an unexpected token. The expected token is 'DOCTYPE'. Line 1, position 3.

Exception

System.Xml.XmlException: 'doctype' is an unexpected token. The expected token is 'DOCTYPE'. Line 1, position 3.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
   at System.Xml.XmlTextReaderImpl.ParseDoctypeDecl()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
   at NzbDrone.Core.Indexers.Newznab.NewznabRssParser.PreProcess(IndexerResponse indexerResponse) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Indexers\Newznab\NewznabRssParser.cs:line 16
   at NzbDrone.Core.Indexers.RssParser.ParseResponse(IndexerResponse indexerResponse) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Indexers\RssParser.cs:line 40
   at NzbDrone.Core.Indexers.HttpIndexerBase`1.FetchPage(IndexerRequest request, IParseIndexerResponse parser) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Indexers\HttpIndexerBase.cs:line 197
   at NzbDrone.Core.Indexers.HttpIndexerBase`1.FetchReleases(IList`1 pageableRequests) in m:\BuildAgent\work\6c3239faf2b92630\src\NzbDrone.Core\Indexers\HttpIndexerBase.cs:line 129

I’m not seeing this behaviour, but based on the message it sounds like either they had a problem and were returning an error page (HTML), or if its still an issue for you something is altering the response.

Thanks for the reply, markus101. When I try opening that page in my browser and try various searches according to the Newznab API found here: http://newznab.readthedocs.org/en/latest/misc/api/, I can see the results without issues. It’s only Sonarr that is having issues parsing the XML. I am running the latest development branch. Any idea on what might be altering the response?

I think I may have found the issue. When i wget this URL: https://www.usenet-crawler.com/rss/api?t=tvsearch&cat=5030,5040&extended=1&apikey=<removed>&offset=0&limit=100 i don’t see the XML response but rather an HTML page that asks me to login. that html page starts with <!doctype html> So I guess, Newznab is looking for logged in users via some sort of cookie or something? which obviously wget didn’t have. Is Sonarr aware of that and is it able to handle that gracefully?

No, that means Usenet crawler has done something to break the newznab API. Sonarr can’t login and get that cookie because it doesn’t know your username and password (and it shouldn’t, thats the point of the API key).

It would be best to contact them about this issue so they can fix it.

Agreed. That’s what I thought too. Thanks for your response.

1 Like

Stupid. The mistake was mine. I didn’t setup the Newznab server properly. The server URL had /rss added to it. Which was the mistake. :confused: :stuck_out_tongue_closed_eyes: