@@ -3,8 +3,6 @@ import { ViewType } from '@/types';
33import ofetch from '@/utils/ofetch' ;
44import { parseDate } from '@/utils/parse-date' ;
55
6- import { appstoreBearerToken } from './utils' ;
7-
86const platformIds = {
97 osx : 'macOS' ,
108 ios : 'iOS' ,
@@ -87,20 +85,20 @@ async function handler(ctx) {
8785 const rootUrl = 'https://apps.apple.com' ;
8886 const currentUrl = new URL ( `${ country } /app/${ id } ` , rootUrl ) . href ;
8987
90- const bearer = await appstoreBearerToken ( ) ;
91-
92- const response = await ofetch ( `https://amp-api-edge.apps.apple.com/v1/catalog/${ country } /apps/${ id . replace ( 'id' , '' ) } ` , {
88+ const response = await ofetch ( `https://apps.apple.com/api/apps/v1/catalog/${ country } /apps/${ id . replace ( 'id' , '' ) } ` , {
9389 headers : {
94- authorization : ` Bearer ${ bearer } ` ,
90+ authorization : ' Bearer' ,
9591 origin : 'https://apps.apple.com' ,
9692 } ,
9793 query : {
9894 platform : 'iphone' ,
9995 additionalPlatforms : 'appletv,ipad,iphone,mac,realityDevice,watch' ,
100- extend : 'accessibility,accessibilityDetails,ageRating,backgroundAssetsInfo,backgroundAssetsInfoWithOptional,customArtwork,customDeepLink,customIconArtwork,customPromotionalText,customScreenshotsByType,customVideoPreviewsByType,description,expectedReleaseDateDisplayFormat,fileSizeByDevice,gameDisplayName,iconArtwork,installSizeByDeviceInBytes,messagesScreenshots,miniGamesDeepLink,minimumOSVersion,privacy,privacyDetails,privacyPolicyUrl,remoteControllerRequirement,requirementsByDeviceFamily,supportURLForLanguage,supportedGameCenterFeatures,supportsFunCamera,supportsSharePlay,versionHistory,websiteUrl' ,
96+ extend : 'accessibility,accessibilityDetails,ageRating,backgroundAssetsInfo,backgroundAssetsInfoWithOptional,customArtwork,customDeepLink,customIconArtwork,customPromotionalText,customScreenshotsByType,customVideoPreviewsByType,description,expectedReleaseDateDisplayFormat,fileSizeByDevice,gameDisplayName,iconArtwork,installSizeByDeviceInBytes,macRequiredCapabilities,medicalDeviceInfo,messagesScreenshots,miniGamesDeepLink,minimumOSVersion,privacy,privacyDetails,privacyPolicyUrl,remoteControllerRequirement,requirementsByDeviceFamily,supportURLForLanguage,supportedGameCenterFeatures,supportsFunCamera,supportsSharePlay,versionHistory,websiteUrl' ,
97+ 'extend[apps]' : 'distributionKind,isVerifiedForAppleSiliconMac' ,
10198 'extend[app-events]' : 'description,productArtwork,productVideo' ,
102- include : 'alternate-apps,app-bundles,customers-also-bought-apps,developer,developer-other-apps,merchandised-in-apps,related-editorial-items,reviews,top-in-apps ' ,
99+ include : 'alternate-apps,app-bundles,customers-also-bought-apps,developer,developer-other-apps,merchandised-in-apps,related-editorial-items,reviews' ,
103100 'include[apps]' : 'app-events' ,
101+ views : 'top-in-app-purchasables' ,
104102 'availableIn[app-events]' : 'future' ,
105103 'sparseLimit[apps:customers-also-bought-apps]' : 40 ,
106104 'sparseLimit[apps:developer-other-apps]' : 40 ,
0 commit comments