]> git.sur5r.net Git - minitube/commitdiff
Fix VEVO
authorFlavio Tordini <flavio.tordini@gmail.com>
Fri, 13 Nov 2015 16:46:20 +0000 (17:46 +0100)
committerFlavio Tordini <flavio.tordini@gmail.com>
Fri, 13 Nov 2015 16:46:20 +0000 (17:46 +0100)
src/video.cpp

index f7b3107da01d33221a4801d3e86c684eae9c344a..5a1dbd00d2fdd00ea5dc7eb090471f9e409bcca2 100644 (file)
@@ -406,8 +406,12 @@ void Video::parseDashManifest(const QByteArray &bytes) {
 void Video::captureFunction(const QString &name, const QString &js) {
     QRegExp funcRe("function\\s+" + QRegExp::escape(name) + "\\s*\\([" + jsNameChars + ",\\s]*\\)\\s*\\{[^\\}]+\\}");
     if (funcRe.indexIn(js) == -1) {
-        qWarning() << "Cannot capture function" << name;
-        return;
+        // try var foo = function(bar) { };
+        funcRe = QRegExp("var\\s+" + QRegExp::escape(name) + "\\s*=\\s*function\\s*\\([" + jsNameChars + ",\\s]*\\)\\s*\\{[^\\}]+\\}");
+        if (funcRe.indexIn(js) == -1) {
+            qWarning() << "Cannot capture function" << name;
+            return;
+        }
     }
     QString func = funcRe.cap(0);
     sigFunctions.insert(name, func);