mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-17 20:09:50 +01:00
Use access_token URL param instead of header hack for Google Drive.
This commit is contained in:
parent
e6e72dc68d
commit
371b63e159
@ -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(),
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user