qDebug() << "available formats" << urlMap.keys();
const QVector<VideoDefinition> &definitions = VideoDefinition::getDefinitions();
- int previousIndex = std::max(definitions.indexOf(definition) - 1, 0);
+ int previousIndex = std::max(definitions.indexOf(definition), 0);
for (; previousIndex >= 0; previousIndex--) {
const VideoDefinition &previousDefinition = definitions.at(previousIndex);
qDebug() << "Testing format" << previousDefinition.getCode();
void YTVideo::loadEmbedPage() {
QUrl url("https://www.youtube.com/embed/" + videoId);
auto reply = HttpUtils::yt().get(url);
- connect(reply, &HttpReply::finished, this, [this](const HttpReply &reply) {
+ connect(reply, &HttpReply::finished, this, [this](auto &reply) {
if (!reply.isSuccessful()) {
getVideoInfo();
return;