@@ -77,14 +77,14 @@ export default class TitleManager {
7777 }
7878 resolve ( officialTitles ) ;
7979 } )
80- . catch ( e => {
80+ . catch ( ( ) => {
8181 resolve ( [ ] ) ;
8282 } ) ;
8383 } ) ;
8484 }
8585
8686 getGamePassProducts ( titles ) {
87- return new Promise ( ( resolve , reject ) => {
87+ return new Promise ( ( resolve ) => {
8888 const productIdQueue = [ ] ;
8989 const v2TitleMap = { } ;
9090 if ( ! Array . isArray ( titles ) ) {
@@ -108,17 +108,27 @@ export default class TitleManager {
108108 const mergeProductIds = [
109109 ...new Set ( [ ...productIdQueue , ...officialTitles ] ) ,
110110 ] ;
111-
112- this . _http . post ( 'catalog.gamepass.com' , `/v3/products?market=US&language=${ lang } &hydration=RemoteLowJade0` , { // RemoteLowJade0
113- 'Products' : mergeProductIds ,
114- } , {
115- 'ms-cv' : 0 ,
116- 'calling-app-name' : 'Xbox Cloud Gaming Web' ,
117- 'calling-app-version' : '24.17.63' ,
118-
119- } ) . then ( ( result : any ) => {
120- if ( result && result . Products ) {
121- const products = result . Products ;
111+
112+ axios
113+ . post (
114+ `https://catalog.gamepass.com/v3/products?market=US&language=${ lang } &hydration=RemoteLowJade0` ,
115+ {
116+ Products : mergeProductIds ,
117+ } ,
118+ {
119+ headers : {
120+ Accept : 'application/json' ,
121+ 'Content-Type' : 'application/json' ,
122+ 'ms-cv' : 0 ,
123+ 'calling-app-name' : 'Xbox Cloud Gaming Web' ,
124+ 'calling-app-version' : '24.17.63' ,
125+ } ,
126+ } ,
127+ )
128+ . then ( res => {
129+ console . log ( 'POST catalog.gamepass.com/v3/products success' )
130+ if ( res . data && res . data . Products ) {
131+ const products = res . data . Products ;
122132 let mergedTitles = [ ] ;
123133 for ( const key in products ) {
124134 if ( v2TitleMap [ key ] ) {
@@ -141,14 +151,16 @@ export default class TitleManager {
141151 return item . titleId || item . XCloudTitleId ;
142152 } ) ;
143153 resolve ( mergedTitles ) ;
144- } else {
154+ } else {
145155 resolve ( [ ] ) ;
146- }
147- } ) . catch ( e => {
148- console . log ( 'getGamePassProducts error:' , e ) ;
149- reject ( e ) ;
156+ }
157+ } )
158+ . catch ( e => {
159+ console . log ( 'getGamePassProducts error:' , e ) ;
160+ // reject(e);
161+ resolve ( [ ] )
162+ } ) ;
150163 } ) ;
151- } ) ;
152164 } )
153165 }
154166
0 commit comments