mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 07:55:18 +00:00
chore: fix home feed not showing up
This commit is contained in:
parent
e1786989ff
commit
e034455173
@ -52,8 +52,9 @@ class AuthenticationCredentials {
|
|||||||
headers: {
|
headers: {
|
||||||
"Cookie": spDc ?? "",
|
"Cookie": spDc ?? "",
|
||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36"
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
|
||||||
},
|
},
|
||||||
|
validateStatus: (status) => true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
final body = res.data;
|
final body = res.data;
|
||||||
@ -65,7 +66,7 @@ class AuthenticationCredentials {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return AuthenticationCredentials(
|
return AuthenticationCredentials(
|
||||||
cookie: "${res.headers["set-cookie"]}; $spDc",
|
cookie: "${res.headers["set-cookie"]?.join(";")}; $spDc",
|
||||||
accessToken: body['accessToken'],
|
accessToken: body['accessToken'],
|
||||||
expiration: DateTime.fromMillisecondsSinceEpoch(
|
expiration: DateTime.fromMillisecondsSinceEpoch(
|
||||||
body['accessTokenExpirationTimestampMs'],
|
body['accessTokenExpirationTimestampMs'],
|
||||||
|
@ -181,35 +181,36 @@ class CustomSpotifyEndpoints {
|
|||||||
'referer': 'https://open.spotify.com/'
|
'referer': 'https://open.spotify.com/'
|
||||||
};
|
};
|
||||||
final response = await _client.getUri(
|
final response = await _client.getUri(
|
||||||
Uri(
|
Uri(
|
||||||
scheme: "https",
|
scheme: "https",
|
||||||
host: "api-partner.spotify.com",
|
host: "api-partner.spotify.com",
|
||||||
path: "/pathfinder/v1/query",
|
path: "/pathfinder/v1/query",
|
||||||
queryParameters: {
|
queryParameters: {
|
||||||
"operationName": "home",
|
"operationName": "home",
|
||||||
"variables": jsonEncode({
|
"variables": jsonEncode({
|
||||||
"timeZone": tz.local.name,
|
"timeZone": tz.local.name,
|
||||||
"sp_t": spTCookie,
|
"sp_t": spTCookie,
|
||||||
"country": country.name,
|
"country": country.name,
|
||||||
"facet": null,
|
"facet": null,
|
||||||
"sectionItemsLimit": 10
|
"sectionItemsLimit": 10
|
||||||
}),
|
}),
|
||||||
"extensions": jsonEncode(
|
"extensions": jsonEncode(
|
||||||
{
|
{
|
||||||
"persistedQuery": {
|
"persistedQuery": {
|
||||||
"version": 1,
|
"version": 1,
|
||||||
|
|
||||||
/// GraphQL persisted Query hash
|
/// GraphQL persisted Query hash
|
||||||
/// This can change overtime. We've to lookout for it
|
/// This can change overtime. We've to lookout for it
|
||||||
/// Docs: https://www.apollographql.com/docs/graphos/operations/persisted-queries/
|
/// Docs: https://www.apollographql.com/docs/graphos/operations/persisted-queries/
|
||||||
"sha256Hash":
|
"sha256Hash":
|
||||||
"eb3fba2d388cf4fc4d696b1757a58584e9538a3b515ea742e9cc9465807340be",
|
"eb3fba2d388cf4fc4d696b1757a58584e9538a3b515ea742e9cc9465807340be",
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
options: Options(headers: headers));
|
options: Options(headers: headers),
|
||||||
|
);
|
||||||
|
|
||||||
final data = SpotifyHomeFeed.fromJson(
|
final data = SpotifyHomeFeed.fromJson(
|
||||||
transformHomeFeedJsonMap(response.data),
|
transformHomeFeedJsonMap(response.data),
|
||||||
|
Loading…
Reference in New Issue
Block a user