QString definitionName = settings.value("definition").toString();
int definitionCode = VideoDefinition::getDefinitionCode(definitionName);
- // qDebug() << "fmtUrlMap" << fmtUrlMap;
+ qDebug() << "fmtUrlMap" << fmtUrlMap;
QStringList formatUrls = fmtUrlMap.split(",", QString::SkipEmptyParts);
QHash<int, QString> urlMap;
foreach(QString formatUrl, formatUrls) {
int format = -1;
QString url;
+ QString sig;
foreach(QString urlParam, urlParams) {
if (urlParam.startsWith("itag=")) {
int separator = urlParam.indexOf("=");
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);