]> git.sur5r.net Git - minitube/blobdiff - src/video.cpp
New upstream version 3.8
[minitube] / src / video.cpp
index 40ed56f2a6ec59cede611447e4e7dd5521103561..fdf7a22f11ce09e681f99b36666c5dc3547ae93a 100644 (file)
@@ -84,8 +84,12 @@ void Video::setWebpage(const QString &value) {
 void Video::loadThumbnail() {
     if (thumbnailUrl.isEmpty() || loadingThumbnail) return;
     loadingThumbnail = true;
-    QObject *reply = HttpUtils::yt().get(thumbnailUrl);
+    auto reply = HttpUtils::yt().get(thumbnailUrl);
     connect(reply, SIGNAL(data(QByteArray)), SLOT(setThumbnail(QByteArray)));
+    connect(reply, &HttpReply::error, this, [this](auto &msg) {
+        qWarning() << msg;
+        loadingThumbnail = false;
+    });
 }
 
 void Video::setDuration(int value) {
@@ -138,6 +142,7 @@ void Video::loadStreamUrlJS() {
     ytjsVideo = new YTJSVideo(id, this);
     connect(ytjsVideo, &YTJSVideo::gotStreamUrl, this, &Video::streamUrlLoaded);
     connect(ytjsVideo, &YTJSVideo::errorStreamUrl, this, [this](const QString &msg) {
+        qDebug() << msg;
         ytjsVideo->deleteLater();
         ytjsVideo = nullptr;
         loadStreamUrlYT();
@@ -153,6 +158,7 @@ void Video::loadStreamUrlYT() {
     ytVideo = new YTVideo(id, this);
     connect(ytVideo, &YTVideo::gotStreamUrl, this, &Video::streamUrlLoaded);
     connect(ytVideo, &YTVideo::errorStreamUrl, this, [this](const QString &msg) {
+        qDebug() << msg;
         emit errorStreamUrl(msg);
         ytVideo->deleteLater();
         ytVideo = nullptr;