another update

This commit is contained in:
2025-07-24 00:48:27 +03:00
parent dfc8e21db1
commit e0217cbbcb
75 changed files with 5331 additions and 4457 deletions

View File

@@ -1,81 +1,83 @@
"use client";
import { getCookie } from "./roblox";
import { proxyFetch } from "./utils";
type RecommendationEntry = {
contentType: "Game"|string,
contentId: number,
contentStringId: string,
contentType: "Game" | string;
contentId: number;
contentStringId: string;
contentMetadata: {
Score: string
}
}
Score: string;
};
};
type RecommendationSort = {
topic: string,
topicId: number,
treatmentType: string,
recommendationList: RecommendationEntry[],
nextPageTokenForTopic: null,
numberOfRows: number,
topicLayoutData: any
}
topic: string;
topicId: number;
treatmentType: string;
recommendationList: RecommendationEntry[];
nextPageTokenForTopic: null;
numberOfRows: number;
topicLayoutData: any;
};
export type ContentMetadata = {
totalUpVotes: number,
totalDownVotes: number,
universeId: number,
name: string,
rootPlaceId: number,
description: null,
playerCount: number,
primaryMediaAsset: any,
under9: boolean,
under13: boolean,
minimumAge: number,
ageRecommendationDisplayName: string,
friendVisits: any[],
friendVisitedString: string,
layoutDataBySort: any
}
totalUpVotes: number;
totalDownVotes: number;
universeId: number;
name: string;
rootPlaceId: number;
description: null;
playerCount: number;
primaryMediaAsset: any;
under9: boolean;
under13: boolean;
minimumAge: number;
ageRecommendationDisplayName: string;
friendVisits: any[];
friendVisitedString: string;
layoutDataBySort: any;
};
export type OmniRecommendation = {
pageType: "Home" | string,
requestId: string,
sortsRefreshInterval: number,
contentMetadata: {
Game: {[id: string]: ContentMetadata},
CatalogAsset: any,
CatalogBundle: any,
RecommendedFriend: any,
GameCoPlay: any
},
nextPageToken: string,
isSessionExpired: boolean,
globalLayoutData: any,
isPartialFeed: boolean,
DebugInfoGroups: boolean,
sorts: RecommendationSort[]
}
pageType: "Home" | string;
requestId: string;
sortsRefreshInterval: number;
contentMetadata: {
Game: { [id: string]: ContentMetadata };
CatalogAsset: any;
CatalogBundle: any;
RecommendedFriend: any;
GameCoPlay: any;
};
nextPageToken: string;
isSessionExpired: boolean;
globalLayoutData: any;
isPartialFeed: boolean;
DebugInfoGroups: boolean;
sorts: RecommendationSort[];
};
export async function getOmniRecommendationsHome(): Promise<OmniRecommendation> {
const data = await proxyFetch(`https://apis.roblox.com/discovery-api/omni-recommendation`,{
method: "POST",
body: JSON.stringify({
pageType: "Home",
sessionId: crypto.randomUUID(),
supportedTreatmentTypes: ["SortlessGrid"],
authIntentData: null,
cpuCores: 4,
maxResolution: "1920x1080",
maxMemory: 8192
}),
headers: {
"Content-Type": "application/json"
const data = await proxyFetch(
`https://apis.roblox.com/discovery-api/omni-recommendation`,
{
method: "POST",
body: JSON.stringify({
pageType: "Home",
sessionId: crypto.randomUUID(),
supportedTreatmentTypes: ["SortlessGrid"],
authIntentData: null,
cpuCores: 4,
maxResolution: "1920x1080",
maxMemory: 8192
}),
headers: {
"Content-Type": "application/json"
}
}
})
return await data.json() as OmniRecommendation
);
return (await data.json()) as OmniRecommendation;
}
// https://apis.roblox.com/discovery-api/omni-recommendation
// https://apis.roblox.com/discovery-api/omni-recommendation