mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Fix RSS parsing
This commit is contained in:
parent
c40801ce99
commit
12280c6a0f
2 changed files with 46 additions and 44 deletions
|
@ -221,28 +221,29 @@ RssArticlePtr xmlToRssArticle(RssFeed* parent, QXmlStreamReader& xml)
|
|||
QDateTime date;
|
||||
QString author;
|
||||
|
||||
Q_ASSERT(xml.isStartElement() && xml.name() == "item");
|
||||
while(!xml.atEnd()) {
|
||||
xml.readNext();
|
||||
|
||||
while (xml.readNextStartElement()) {
|
||||
if (xml.name() == "title")
|
||||
title = xml.readElementText();
|
||||
else if (xml.name() == "enclosure") {
|
||||
if (xml.attributes().value("type") == "application/x-bittorrent")
|
||||
torrentUrl = xml.attributes().value("url").toString();
|
||||
}
|
||||
else if (xml.name() == "link")
|
||||
link = xml.readElementText();
|
||||
else if (xml.name() == "description")
|
||||
description = xml.readElementText();
|
||||
else if (xml.name() == "pubDate")
|
||||
date = RssArticle::parseDate(xml.readElementText());
|
||||
else if (xml.name() == "author")
|
||||
author = xml.readElementText();
|
||||
else if (xml.name() == "guid")
|
||||
guid = xml.readElementText();
|
||||
else {
|
||||
qDebug() << "Skipping item tag: " << xml.name();
|
||||
xml.skipCurrentElement();
|
||||
if(xml.isEndElement() && xml.name() == "item")
|
||||
break;
|
||||
|
||||
if (xml.isStartElement()) {
|
||||
if (xml.name() == "title")
|
||||
title = xml.readElementText();
|
||||
else if (xml.name() == "enclosure") {
|
||||
if (xml.attributes().value("type") == "application/x-bittorrent")
|
||||
torrentUrl = xml.attributes().value("url").toString();
|
||||
}
|
||||
else if (xml.name() == "link")
|
||||
link = xml.readElementText();
|
||||
else if (xml.name() == "description")
|
||||
description = xml.readElementText();
|
||||
else if (xml.name() == "pubDate")
|
||||
date = RssArticle::parseDate(xml.readElementText());
|
||||
else if (xml.name() == "author")
|
||||
author = xml.readElementText();
|
||||
else if (xml.name() == "guid")
|
||||
guid = xml.readElementText();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue