Use access_token URL param instead of header hack for Google Drive.

This commit is contained in:
John Maguire 2012-11-02 16:47:40 +01:00
parent e6e72dc68d
commit 371b63e159
2 changed files with 1 additions and 15 deletions

View File

@ -739,20 +739,6 @@ void GstEnginePipeline::SourceSetupCallback(GstURIDecodeBin* bin, GParamSpec *ps
gst_structure_free(headers);
}
if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "extra-headers") &&
instance->url().host().contains("googleusercontent.com") &&
instance->url().hasFragment()) {
QByteArray authorization = QString("Bearer %1").arg(
instance->url().fragment()).toAscii();
GstStructure* headers = gst_structure_new(
"extra-headers",
"Authorization", G_TYPE_STRING,
authorization.constData(),
NULL);
g_object_set(element, "extra-headers", headers, NULL);
gst_structure_free(headers);
}
if (g_object_class_find_property(G_OBJECT_GET_CLASS(element), "user-agent")) {
QString user_agent = QString("%1 %2").arg(
QCoreApplication::applicationName(),

View File

@ -236,7 +236,7 @@ QUrl GoogleDriveService::GetStreamingUrlFromSongId(const QString& id) {
loop.exec();
QUrl url(response->file().download_url());
url.setFragment(client_->access_token());
url.addQueryItem("access_token", client_->access_token());
return url;
}