From 325c7b7b493b4f760acd392f97d2b512e4b3f34e Mon Sep 17 00:00:00 2001 From: Physick <96335032+DegustatorPonos@users.noreply.github.com> Date: Mon, 11 May 2026 14:10:04 +0500 Subject: RSS spec compliance update --- src/RSS.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/RSS.cpp') diff --git a/src/RSS.cpp b/src/RSS.cpp index 20c809f..a5c8b12 100644 --- a/src/RSS.cpp +++ b/src/RSS.cpp @@ -67,7 +67,9 @@ void RSS::parse(std::string contents) { // std::cout << "starting tokenization..." << std::endl; if (contents.length() == 0) return; try { - auto leaf = XML_leaf(contents).GetChild("channel"); + auto leaf = XML_leaf(contents); + if (leaf.Name != "channel") + leaf = leaf.GetChild("channel"); if (leaf.Raw == "<>") throw new std::runtime_error("The feed does not contain element"); @@ -76,8 +78,8 @@ void RSS::parse(std::string contents) { auto items = leaf.GetChildren("item"); for (auto item : items) Entries.push_back(RSS_Entry(item)); - } catch (const char *err) { - std::cout << "Failed to parse feed '" << URL << "' :" << err << std::endl; + } catch (std::exception& err) { + std::cout << "Failed to parse feed '" << URL << "' :" << err.what() << std::endl; return; } } -- cgit v1.3