+#ifdef APP_YT3
+
+void YTStandardFeed::loadVideos(int max, int startIndex) {
+ aborted = false;
+
+ QUrl url = YT3::instance().method("videos");
+
+#if QT_VERSION >= 0x050000
+ {
+ QUrl &u = url;
+ QUrlQuery url;
+#endif
+
+ if (startIndex > 1) {
+ if (maybeReloadToken(max, startIndex)) return;
+ url.addQueryItem("pageToken", nextPageToken);
+ }
+
+ url.addQueryItem("part", "snippet,contentDetails,statistics");
+ url.addQueryItem("chart", "mostPopular");
+
+ if (!category.isEmpty())
+ url.addQueryItem("videoCategoryId", category);
+
+ if (!regionId.isEmpty())
+ url.addQueryItem("regionCode", regionId);
+
+ url.addQueryItem("maxResults", QString::number(max));
+
+#if QT_VERSION >= 0x050000
+ u.setQuery(url);
+ }
+#endif
+ QObject *reply = The::http()->get(url);
+ connect(reply, SIGNAL(data(QByteArray)), SLOT(parseResults(QByteArray)));
+ connect(reply, SIGNAL(error(QNetworkReply*)), SLOT(requestError(QNetworkReply*)));
+}
+
+void YTStandardFeed::parseResults(QByteArray data) {
+ if (aborted) return;
+
+ YT3ListParser parser(data);
+ QList<Video*> videos = parser.getVideos();
+
+ bool tryingWithNewToken = setPageToken(parser.getNextPageToken());
+ if (tryingWithNewToken) return;
+
+ if (reloadingToken) {
+ reloadingToken = false;
+ loadVideos(currentMax, currentStartIndex);
+ currentMax = currentStartIndex = 0;
+ return;
+ }
+
+ emit gotVideos(videos);
+ emit finished(videos.size());
+}
+
+#else
+
+void YTStandardFeed::loadVideos(int max, int startIndex) {