From: Flavio Tordini Date: Fri, 13 Nov 2015 16:46:20 +0000 (+0100) Subject: Fix VEVO X-Git-Tag: 2.5.1~2 X-Git-Url: https://git.sur5r.net/?p=minitube;a=commitdiff_plain;h=dce4ad17f45042ff27004368e8eed958a8bda991 Fix VEVO --- diff --git a/src/video.cpp b/src/video.cpp index f7b3107..5a1dbd0 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -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);