From: Flavio Date: Thu, 27 Sep 2012 09:52:24 +0000 (+0200) Subject: Adapted to Youtube changes X-Git-Tag: 1.9~3 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e2944615843065c08eccdef04122765dd3fc95b1;p=minitube Adapted to Youtube changes --- diff --git a/src/video.cpp b/src/video.cpp index d414990..a7f6e5c 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -142,7 +142,7 @@ void Video::gotVideoInfo(QByteArray data) { QString definitionName = settings.value("definition").toString(); int definitionCode = VideoDefinition::getDefinitionCode(definitionName); - // qDebug() << "fmtUrlMap" << fmtUrlMap; + qDebug() << "fmtUrlMap" << fmtUrlMap; QStringList formatUrls = fmtUrlMap.split(",", QString::SkipEmptyParts); QHash urlMap; foreach(QString formatUrl, formatUrls) { @@ -152,6 +152,7 @@ void Video::gotVideoInfo(QByteArray data) { int format = -1; QString url; + QString sig; foreach(QString urlParam, urlParams) { if (urlParam.startsWith("itag=")) { int separator = urlParam.indexOf("="); @@ -160,10 +161,16 @@ void Video::gotVideoInfo(QByteArray data) { int separator = urlParam.indexOf("="); url = urlParam.mid(separator + 1); url = QByteArray::fromPercentEncoding(url.toUtf8()); + } else if (urlParam.startsWith("sig=")) { + int separator = urlParam.indexOf("="); + sig = urlParam.mid(separator + 1); + sig = QByteArray::fromPercentEncoding(sig.toUtf8()); } } if (format == -1 || url.isNull()) continue; + url += "&signature=" + sig; + if (format == definitionCode) { qDebug() << "Found format" << definitionCode; QUrl videoUrl = QUrl::fromEncoded(url.toUtf8(), QUrl::StrictMode);