@@ -156,6 +156,10 @@ const parseAirings = async (events: any[]) => {
156
156
const start = moment ( event . start ) ;
157
157
const end = moment ( event . end ) ;
158
158
159
+ if ( ! useLinear ) {
160
+ start . subtract ( 30 , 'minutes' ) ; // For Pre-game
161
+ }
162
+
159
163
if ( end . isBefore ( now ) || start . isAfter ( inTwoDays ) ) {
160
164
continue ;
161
165
}
@@ -270,7 +274,6 @@ class GothamHandler {
270
274
return ;
271
275
}
272
276
273
- await this . getNewTokens ( ) ;
274
277
await this . authenticateRegCode ( ) ;
275
278
276
279
if ( moment ( ) . add ( 20 , 'hours' ) . isAfter ( this . expiresIn ) ) {
@@ -391,7 +394,7 @@ class GothamHandler {
391
394
categories : [ 'Gotham' , 'HD' , 'Sports' , airing . net || 'MSG' , airing . aw_tm , airing . hm_tm , airing . spt_lg ] ,
392
395
contentId : `${ airing . id } ----${ airing . cid } ` ,
393
396
end : airing . ev_ed_dt ,
394
- network : airing . net ,
397
+ network : ` ${ airing . pn } ` . toUpperCase ( ) ,
395
398
sport : airing . spt_lg ,
396
399
start : airing . ev_st_dt ,
397
400
title : eventName ,
@@ -408,7 +411,7 @@ class GothamHandler {
408
411
409
412
public getEventData = async ( eventId : string ) : Promise < [ string , IHeaders ] > => {
410
413
try {
411
- const [ contentId , channelId ] = eventId . split ( '----' ) ;
414
+ const [ , channelId ] = eventId . split ( '----' ) ;
412
415
413
416
const event = await db . entries . findOne < IEntry > ( { id : eventId } ) ;
414
417
@@ -425,8 +428,8 @@ class GothamHandler {
425
428
const { data} = await axios . post (
426
429
`${ authUrl } ` ,
427
430
{
428
- catalogType : useLinear ? 'channel' : 'liveevent ',
429
- contentId : useLinear ? channelId : contentId ,
431
+ catalogType : 'channel' ,
432
+ contentId : channelId ,
430
433
contentTypeId : 'live' ,
431
434
delivery : 'streaming' ,
432
435
deviceId : this . device_id ,
@@ -859,8 +862,6 @@ class GothamHandler {
859
862
860
863
this . save ( ) ;
861
864
862
- // await this.refreshProviderToken();
863
-
864
865
const adobeId = await this . getAdobeId ( ) ;
865
866
const adobeUserMeta = await this . getUserMetadata ( ) ;
866
867
@@ -971,23 +972,6 @@ class GothamHandler {
971
972
}
972
973
} ;
973
974
974
- private refreshProviderToken = async ( ) : Promise < void > => {
975
- if ( ! this . adobe_token ) {
976
- return ;
977
- }
978
-
979
- // const renewUrl = [`${BASE_ADOBE_URL}/tokens/authn`, `?deviceId=${this.device_id}`, '&requestor=Gotham'].join('');
980
-
981
- // try {
982
- // await axios.get(renewUrl, {
983
- // headers: {
984
- // Authorization: `Bearer ${this.adobe_token}`,
985
- // 'User-Agent': okHttpUserAgent,
986
- // },
987
- // });
988
- // } catch (e) {}
989
- } ;
990
-
991
975
private save = async ( ) => {
992
976
await db . providers . update (
993
977
{ name : 'gotham' } ,
0 commit comments