Skip to content

Commit

Permalink
fix #1202: Некоторые ленты не обрабатывались
Browse files Browse the repository at this point in the history
  • Loading branch information
Funcy-dcm committed Nov 17, 2019
1 parent 6ed57ea commit 004188d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/faviconobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ void FaviconObject::getQueuedUrl()
void FaviconObject::slotGet(const QUrl &getUrl, const QString &feedUrl, const int &cnt)
{
QNetworkRequest request(getUrl);
// QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) QuiteRSS/%2 Safari/%1").
// arg(qWebKitVersion()).arg(STRPRODUCTVER);
// request.setRawHeader("User-Agent", userAgent.toUtf8());
QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/%1").
arg(qWebKitVersion());
request.setRawHeader("User-Agent", userAgent.toUtf8());

currentUrls_.append(getUrl);
currentFeeds_.append(feedUrl);
Expand Down
16 changes: 8 additions & 8 deletions src/requestfeed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ void RequestFeed::getQueuedUrl()
void RequestFeed::slotHead(const QUrl &getUrl, const int &id, const QString &feedUrl,
const QDateTime &date, const int &count)
{
qDebug() << objectName() << "::head:" << getUrl.toEncoded() << "feed:" << feedUrl;
qDebug() << objectName() << "::head:" << getUrl.toEncoded() << "feed:" << feedUrl << count;
QNetworkRequest request(getUrl);
// QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) QuiteRSS/%2 Safari/%1").
// arg(qWebKitVersion()).arg(STRPRODUCTVER);
// request.setRawHeader("User-Agent", userAgent.toUtf8());
QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/%1").
arg(qWebKitVersion());
request.setRawHeader("User-Agent", userAgent.toUtf8());

currentUrls_.append(getUrl);
currentIds_.append(id);
Expand All @@ -175,12 +175,12 @@ void RequestFeed::slotHead(const QUrl &getUrl, const int &id, const QString &fee
void RequestFeed::slotGet(const QUrl &getUrl, const int &id, const QString &feedUrl,
const QDateTime &date, const int &count)
{
qDebug() << objectName() << "::get:" << getUrl.toEncoded() << "feed:" << feedUrl;
qDebug() << objectName() << "::get:" << getUrl.toEncoded() << "feed:" << feedUrl << count;
QNetworkRequest request(getUrl);
request.setRawHeader("Accept", "application/atom+xml,application/rss+xml;q=0.9,application/xml;q=0.8,text/xml;q=0.7,*/*;q=0.6");
// QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) QuiteRSS/%2 Safari/%1").
// arg(qWebKitVersion()).arg(STRPRODUCTVER);
// request.setRawHeader("User-Agent", userAgent.toUtf8());
QString userAgent = QString("Mozilla/5.0 (Windows NT 6.1) AppleWebKit/%1 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/%1").
arg(qWebKitVersion());
request.setRawHeader("User-Agent", userAgent.toUtf8());

currentUrls_.append(getUrl);
currentIds_.append(id);
Expand Down

4 comments on commit 004188d

@tieugene
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Мда... агент а) прибит гвоздями и б) в трех местах?

@Funcy-dcm
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это тянется ещё с начала разработки. Понимаю что надо переделать, но уже не тянет переписывать ) На днях попробую поправить

@tieugene
Copy link

@tieugene tieugene commented on 004188d Nov 22, 2019 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Funcy-dcm
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Потому-что в Qt5 настройки по умолчанию уже в другом месте, тут мы ничего не смогли сделать, поздно узнали

Please sign in to comment.