mlbserver 2023.3.13 → 2023.3.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # mlbserver
2
2
 
3
- Current version 2023.03.13
3
+ Current version 2023.03.31
4
4
 
5
5
  Credit to https://github.com/tonycpsu/streamglob and https://github.com/mafintosh/hls-decryptor
6
6
 
package/index.js CHANGED
@@ -1187,9 +1187,11 @@ app.get('/', async function(req, res) {
1187
1187
  var cache_data = await session.getDayData(gameDate)
1188
1188
  var big_inning
1189
1189
  if ( cache_data.dates && cache_data.dates[0] && (cache_data.dates[0].date >= today) && cache_data.dates[0].games && (cache_data.dates[0].games.length > 1) && cache_data.dates[0].games[0] && (cache_data.dates[0].games[0].seriesDescription == 'Regular Season') ) {
1190
- // Disabled Big Inning specific schedule scraping
1191
- //big_inning = await session.getBigInningSchedule(gameDate)
1192
- big_inning = await session.generateBigInningSchedule(gameDate)
1190
+ // Scraped Big Inning schedule
1191
+ big_inning = await session.getBigInningSchedule(gameDate)
1192
+
1193
+ // Generated Big Inning schedule (disabled)
1194
+ //big_inning = await session.generateBigInningSchedule(gameDate)
1193
1195
  }
1194
1196
 
1195
1197
  var linkType = VALID_LINK_TYPES[0]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mlbserver",
3
- "version": "2023.03.13",
3
+ "version": "2023.03.31",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
package/session.js CHANGED
@@ -2391,10 +2391,10 @@ class sessionClass {
2391
2391
  let title = 'MLB Big Inning'
2392
2392
  let description = 'Live look-ins and big moments from around the league'
2393
2393
 
2394
- // Disabled Big Inning specific schedule scraping
2395
- /*if ( cache_data.dates && cache_data.dates[0] && (cache_data.dates[0].date >= today) && cache_data.dates[0].games && (cache_data.dates[0].games.length > 0) && cache_data.dates[0].games[0] && (cache_data.dates[0].games[0].seriesDescription == 'Regular Season') ) {
2394
+ // Scraped Big Inning schedule
2395
+ if ( cache_data.dates && cache_data.dates[0] && (cache_data.dates[0].date >= today) && cache_data.dates[0].games && (cache_data.dates[0].games.length > 0) && cache_data.dates[0].games[0] && (cache_data.dates[0].games[0].seriesDescription == 'Regular Season') ) {
2396
2396
  await this.getBigInningSchedule()
2397
- }*/
2397
+ }
2398
2398
 
2399
2399
  for (var i = 0; i < cache_data.dates.length; i++) {
2400
2400
  this.debuglog('getTVData processing Big Inning for date ' + cache_data.dates[i].date)
@@ -2404,12 +2404,14 @@ class sessionClass {
2404
2404
  //if ( (gameDate >= today) && cache_data.dates[i].games && (cache_data.dates[i].games.length > 1) && cache_data.dates[i].games[0] && (cache_data.dates[i].games[0].seriesDescription == 'Regular Season') ) {
2405
2405
  if ( (gameDate >= today) && cache_data.dates[i].games && (cache_data.dates[i].games.length > 1) && cache_data.dates[i].games[0] && (cache_data.dates[i].games[0].seriesDescription == 'Regular Season') ) {
2406
2406
  this.debuglog('getTVData Big Inning active for date ' + cache_data.dates[i].date)
2407
- // Disabled Big Inning specific schedule scraping
2408
- /*let start = this.convertDateToXMLTV(new Date(this.cache.bigInningSchedule[gameDate].start))
2409
- let stop = this.convertDateToXMLTV(new Date(this.cache.bigInningSchedule[gameDate].end))*/
2410
- let big_inning = await this.generateBigInningSchedule(gameDate)
2407
+ // Scraped Big Inning schedule
2408
+ let start = this.convertDateToXMLTV(new Date(this.cache.bigInningSchedule[gameDate].start))
2409
+ let stop = this.convertDateToXMLTV(new Date(this.cache.bigInningSchedule[gameDate].end))
2410
+
2411
+ // Generated Big Inning schedule (disabled)
2412
+ /*let big_inning = await this.generateBigInningSchedule(gameDate)
2411
2413
  let start = this.convertDateToXMLTV(new Date(big_inning.start))
2412
- let stop = this.convertDateToXMLTV(new Date(big_inning.end))
2414
+ let stop = this.convertDateToXMLTV(new Date(big_inning.end))*/
2413
2415
 
2414
2416
  programs += await this.generate_xml_program(channelid, start, stop, title, description, logo)
2415
2417
  }
@@ -2945,11 +2947,18 @@ class sessionClass {
2945
2947
  // first column is date
2946
2948
  case 1:
2947
2949
  // split date into array
2948
- parts = col[0].split(' ')
2950
+ // old date format (January 1, 1970) (disabled)
2951
+ /*parts = col[0].split(' ')
2949
2952
  year = parts[2]
2950
2953
  // get month index, zero-based
2951
2954
  month = new Date(Date.parse(parts[0] +" 1, 2021")).getMonth()
2952
- day = parts[1].substring(0,parts[1].length-3)
2955
+ day = parts[1].substring(0,parts[1].length-3)*/
2956
+ // new date format (01/01/70)
2957
+ parts = col[0].split('/')
2958
+ year = '20' + parts[2]
2959
+ // get month index, zero-based
2960
+ month = parseInt(parts[0]) - 1
2961
+ day = parts[1]
2953
2962
  this_datestring = new Date(year, month, day).toISOString().substring(0,10)
2954
2963
  this.cache.bigInningSchedule[this_datestring] = {}
2955
2964
  // increment month index (not zero-based)
@@ -3434,7 +3443,7 @@ class sessionClass {
3434
3443
  }
3435
3444
 
3436
3445
  // Game is not broadcast
3437
- if ( cache_data.dates[0].games[i].content && cache_data.dates[0].games[i].content.media && cache_data.dates[0].games[i].content.media.epg && (cache_data.dates[0].games[i].content.media.epg.length > 0) && (cache_data.dates[0].games[i].content.media.epg[0].title == 'MLBTV') && cache_data.dates[0].games[i].content.media.epg[0].items && (cache_data.dates[0].games[i].content.media.epg[0].items.length > 0) ) {
3446
+ if ( !cache_data.dates[0].games[i].content || !cache_data.dates[0].games[i].content.media || !cache_data.dates[0].games[i].content.media.epg || (cache_data.dates[0].games[i].content.media.epg.length == 0) || (cache_data.dates[0].games[i].content.media.epg[0].title != 'MLBTV') || !cache_data.dates[0].games[i].content.media.epg[0].items || (cache_data.dates[0].games[i].content.media.epg[0].items.length == 0) ) {
3438
3447
  omitted_games.no_broadcast.push(teams)
3439
3448
  continue
3440
3449
  }