mlbserver 2026.2.22 → 2026.3.15
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/index.js +33 -2
- package/package.json +1 -1
- package/session.js +41 -5
package/index.js
CHANGED
|
@@ -1684,6 +1684,33 @@ app.get('/', async function(req, res) {
|
|
|
1684
1684
|
let currentDate = new Date()
|
|
1685
1685
|
|
|
1686
1686
|
let entitlements = await session.getEntitlements()
|
|
1687
|
+
|
|
1688
|
+
// MASN live stream for entitled subscribers
|
|
1689
|
+
try {
|
|
1690
|
+
if ( entitlements.includes('MASN_110') ) {
|
|
1691
|
+
body += '<tr><td><span class="tooltip">MASN<span class="tooltiptext">MASN live stream for entitled subscribers. <a href="https://support.mlb.com/s/article/MASN-In-Market-Offering">See here for more information</a>.</span></span></td><td>'
|
|
1692
|
+
let querystring = '?event=MASN'
|
|
1693
|
+
let multiviewquerystring = querystring + '&resolution=' + DEFAULT_MULTIVIEW_RESOLUTION
|
|
1694
|
+
if ( linkType == VALID_LINK_TYPES[0] ) {
|
|
1695
|
+
if ( startFrom != VALID_START_FROM[0] ) querystring += '&startFrom=' + startFrom
|
|
1696
|
+
if ( controls != VALID_CONTROLS[0] ) querystring += '&controls=' + controls
|
|
1697
|
+
}
|
|
1698
|
+
if ( resolution != VALID_RESOLUTIONS[0] ) querystring += '&resolution=' + resolution
|
|
1699
|
+
if ( linkType == VALID_LINK_TYPES[1] ) {
|
|
1700
|
+
if ( force_vod != VALID_FORCE_VOD[0] ) querystring += '&force_vod=' + force_vod
|
|
1701
|
+
} else if ( linkType == VALID_LINK_TYPES[4] ) {
|
|
1702
|
+
querystring += '&filename=' + gameDate + ' MASN'
|
|
1703
|
+
}
|
|
1704
|
+
querystring += content_protect_b
|
|
1705
|
+
multiviewquerystring += content_protect_b
|
|
1706
|
+
body += '<a href="' + thislink + querystring + '">MASN</a>'
|
|
1707
|
+
body += '<input type="checkbox" value="http://127.0.0.1:' + session.data.port + '/stream.m3u8' + multiviewquerystring + '" onclick="addmultiview(this)">'
|
|
1708
|
+
body += '</td></tr>' + "\n"
|
|
1709
|
+
} // end entitlements check
|
|
1710
|
+
} catch (e) {
|
|
1711
|
+
session.debuglog('MASN detect error : ' + e.message)
|
|
1712
|
+
}
|
|
1713
|
+
|
|
1687
1714
|
// MLB Network live stream for eligible USA subscribers
|
|
1688
1715
|
try {
|
|
1689
1716
|
if ( entitlements.includes('MLBN') || entitlements.includes('EXECMLB') || entitlements.includes('MLBTVMLBNADOBEPASS') ) {
|
|
@@ -2438,7 +2465,7 @@ app.get('/', async function(req, res) {
|
|
|
2438
2465
|
resolution = 'best'
|
|
2439
2466
|
}
|
|
2440
2467
|
|
|
2441
|
-
body += '<p><span class="tooltip">All<span class="tooltiptext">Will include all entitled live MLB broadcasts (games plus Big Inning, Game Changer, and Multiview, as well as MLB Network, SNLA, and/or SNY as appropriate). If favorite team(s) have been provided, it will also include affiliate games for those organizations. Channels/games subject to blackout will be omitted by default. See below for an additional option to override that.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + content_protect_b + '">channels.m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + content_protect_b + '">guide.xml</a> and <a href="' + http_root + '/calendar.ics?mediaType=' + mediaType + content_protect_b + '">calendar.ics</a></p>' + "\n"
|
|
2468
|
+
body += '<p><span class="tooltip">All<span class="tooltiptext">Will include all entitled live MLB broadcasts (games plus Big Inning, Game Changer, and Multiview, as well as MASN, MLB Network, SNLA, and/or SNY as appropriate). If favorite team(s) have been provided, it will also include affiliate games for those organizations. Channels/games subject to blackout will be omitted by default. See below for an additional option to override that.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + content_protect_b + '">channels.m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + content_protect_b + '">guide.xml</a> and <a href="' + http_root + '/calendar.ics?mediaType=' + mediaType + content_protect_b + '">calendar.ics</a></p>' + "\n"
|
|
2442
2469
|
|
|
2443
2470
|
let include_teams = 'ath,atl'
|
|
2444
2471
|
if ( (session.credentials.fav_teams.length > 0) && (session.credentials.fav_teams[0].length > 0) ) {
|
|
@@ -2457,6 +2484,10 @@ app.get('/', async function(req, res) {
|
|
|
2457
2484
|
|
|
2458
2485
|
body += '<p><span class="tooltip">Include (or exclude) Winter Leagues<span class="tooltiptext">Winter leagues include the Arizona Fall League, Dominican Winter League aka Liga de Beisbol Dominicano, and Mexican Winter League aka Liga Mexicana del Pacífico. Live stream only, does not support starting from the beginning or certain innings, skip options, etc.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + '&includeTeams=winter' + content_protect_b + '">m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + '&includeTeams=winter' + content_protect_b + '">xml</a> and <a href="' + http_root + '/calendar.ics?mediaType=' + mediaType + '&includeTeams=winter' + content_protect_b + '">ics</a></p>' + "\n"
|
|
2459
2486
|
|
|
2487
|
+
if ( entitlements.includes('MASN_110') ) {
|
|
2488
|
+
body += '<p><span class="tooltip">Include (or exclude) MASN<span class="tooltiptext">MASN live stream for entitled subscribers. <a href="https://support.mlb.com/s/article/MASN-In-Market-Offering">See here for more information</a>.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + '&includeTeams=masn' + content_protect_b + '">m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + '&includeTeams=masn' + content_protect_b + '">xml</a></p>' + "\n"
|
|
2489
|
+
}
|
|
2490
|
+
|
|
2460
2491
|
if ( entitlements.includes('MLBN') || entitlements.includes('EXECMLB') || entitlements.includes('MLBTVMLBNADOBEPASS') ) {
|
|
2461
2492
|
body += '<p><span class="tooltip">Include (or exclude) MLB Network<span class="tooltiptext">MLB Network live stream is now available in the USA for paid MLBTV subscribers or as a paid add-on, in addition to authenticated TV subscribers. <a href="https://support.mlb.com/s/article/MLB-Network-Streaming-FAQ">See here for more information</a>.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + '&includeTeams=mlbn' + content_protect_b + '">m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + '&includeTeams=mlbn' + content_protect_b + '">xml</a></p>' + "\n"
|
|
2462
2493
|
}
|
|
@@ -2466,7 +2497,7 @@ app.get('/', async function(req, res) {
|
|
|
2466
2497
|
}
|
|
2467
2498
|
|
|
2468
2499
|
if ( entitlements.includes('SNY_121') ) {
|
|
2469
|
-
body += '<p><span class="tooltip">Include (or exclude) SNY<span class="tooltiptext">SNY live stream for entitled subscribers. <a href="https://support.mlb.com/s/article/
|
|
2500
|
+
body += '<p><span class="tooltip">Include (or exclude) SNY<span class="tooltiptext">SNY live stream for entitled subscribers. <a href="https://support.mlb.com/s/article/SNY-In-Market-Offering">See here for more information</a>.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + '&includeTeams=sny' + content_protect_b + '">m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + '&includeTeams=sny' + content_protect_b + '">xml</a></p>' + "\n"
|
|
2470
2501
|
}
|
|
2471
2502
|
|
|
2472
2503
|
body += '<p><span class="tooltip">Include (or exclude) Big Inning<span class="tooltiptext">Big Inning is the live look-in and highlights show. <a href="https://www.mlb.com/live-stream-games/big-inning">See here for more information</a>.</span></span>: <a href="' + http_root + '/channels.m3u?mediaType=' + mediaType + '&resolution=' + resolution + '&includeTeams=biginning' + content_protect_b + '">m3u</a> and <a href="' + http_root + '/guide.xml?mediaType=' + mediaType + '&includeTeams=biginning' + content_protect_b + '">xml</a> and <a href="' + http_root + '/calendar.ics?mediaType=' + mediaType + '&includeTeams=biginning' + content_protect_b + '">ics</a></p>' + "\n"
|
package/package.json
CHANGED
package/session.js
CHANGED
|
@@ -2500,10 +2500,11 @@ class sessionClass {
|
|
|
2500
2500
|
|
|
2501
2501
|
if ( (broadcast.type == 'TV') || ((mediaType == 'Audio') && (broadcast.language == language)) ) {
|
|
2502
2502
|
let teamType = broadcast.homeAway
|
|
2503
|
+
let opponent_teamType = 'away'
|
|
2503
2504
|
|
|
2504
|
-
if ( (mediaType == 'MLBTV') && (cache_data.dates[i].games[j].seriesDescription != 'Regular Season') && (cache_data.dates[i].games[j].seriesDescription != 'Spring Training') ) {
|
|
2505
|
+
/*if ( (mediaType == 'MLBTV') && (cache_data.dates[i].games[j].seriesDescription != 'Regular Season') && (cache_data.dates[i].games[j].seriesDescription != 'Spring Training') ) {
|
|
2505
2506
|
teamType = 'NATIONAL'
|
|
2506
|
-
}
|
|
2507
|
+
}*/
|
|
2507
2508
|
let team = cache_data.dates[i].games[j].teams['home'].team.abbreviation
|
|
2508
2509
|
let opponent_team = cache_data.dates[i].games[j].teams['away'].team.abbreviation
|
|
2509
2510
|
|
|
@@ -2518,7 +2519,6 @@ class sessionClass {
|
|
|
2518
2519
|
}
|
|
2519
2520
|
} else {
|
|
2520
2521
|
teamType = teamType.toLowerCase()
|
|
2521
|
-
let opponent_teamType = 'away'
|
|
2522
2522
|
if ( teamType == 'away' ) {
|
|
2523
2523
|
opponent_teamType = 'home'
|
|
2524
2524
|
}
|
|
@@ -2528,8 +2528,9 @@ class sessionClass {
|
|
|
2528
2528
|
if ( (excludeTeams.length > 0) && (excludeTeams.includes(team) || excludeTeams.includes(opponent_team) || ((teamType == 'NATIONAL') && excludeTeams.includes(teamType))) ) {
|
|
2529
2529
|
continue
|
|
2530
2530
|
} else if ( (includeTeams.length == 0) || includeTeams.includes(team) || ((teamType == 'NATIONAL') && (includeTeams.includes(teamType) || includeTeams.includes(opponent_team))) || ((broadcast_count == 1) && includeTeams.includes(opponent_team)) || ((broadcast.freeGame == true) && includeTeams.includes('FREE')) ) {
|
|
2531
|
-
if ( (broadcast_count == 1) && !includeTeams.includes(team) && includeTeams.includes(opponent_team) ) {
|
|
2531
|
+
if ( (teamType != 'NATIONAL') && (broadcast_count == 1) && !includeTeams.includes(team) && includeTeams.includes(opponent_team) ) {
|
|
2532
2532
|
team = opponent_team
|
|
2533
|
+
teamType = opponent_teamType
|
|
2533
2534
|
}
|
|
2534
2535
|
let logo = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRi5AKF6eAu9Va9BzZzgw0PSsQXw8rXPiQLHA'
|
|
2535
2536
|
let seriesId = 'MLB'
|
|
@@ -2763,6 +2764,39 @@ class sessionClass {
|
|
|
2763
2764
|
channels = this.sortObj(channels)
|
|
2764
2765
|
|
|
2765
2766
|
let entitlements = await this.getEntitlements()
|
|
2767
|
+
|
|
2768
|
+
// MASN live stream for entitled subscribers
|
|
2769
|
+
try {
|
|
2770
|
+
if ( (entitlements.includes('MASN_110')) ) {
|
|
2771
|
+
if ( (mediaType == 'MLBTV') && ((includeLevels.length == 0) || includeLevels.includes('MLB') || includeLevels.includes('ALL')) ) {
|
|
2772
|
+
if ( (excludeTeams.length > 0) && excludeTeams.includes('MASN') ) {
|
|
2773
|
+
// do nothing
|
|
2774
|
+
} else if ( (includeTeams.length == 0) || includeTeams.includes('MASN') ) {
|
|
2775
|
+
this.debuglog('getTVData processing MASN')
|
|
2776
|
+
let logo = 'https://img.mlbstatic.com/mlb-images/image/upload/t_16x9/t_w640/v1745242435/mlb/jov4fxbzmqikc8umj5kr.png'
|
|
2777
|
+
let channelid = mediaType + '.MASN'
|
|
2778
|
+
//if ( this.protection.content_protect ) logo += '&content_protect=' + this.protection.content_protect
|
|
2779
|
+
let stream = server + '/stream.m3u8?event=masn&mediaType=Video&resolution=' + resolution
|
|
2780
|
+
if ( this.protection.content_protect ) stream += '&content_protect=' + this.protection.content_protect
|
|
2781
|
+
if ( pipe == 'true' ) stream = await this.convert_stream_to_pipe(stream, channelid)
|
|
2782
|
+
channels[channelid] = await this.create_channel_object(channelid, logo, stream, mediaType)
|
|
2783
|
+
|
|
2784
|
+
let title = 'MASN'
|
|
2785
|
+
let description = 'Live stream of MASN (Mid-Atlantic Sports Network)'
|
|
2786
|
+
|
|
2787
|
+
let start = this.convertDateToXMLTV(new Date(cache_data.dates[0].date + ' 00:00:00'))
|
|
2788
|
+
let stop = this.convertDateToXMLTV(new Date(cache_data.dates[cache_data.dates.length-1].date + ' 00:00:00'))
|
|
2789
|
+
|
|
2790
|
+
// MASN guide XML
|
|
2791
|
+
programs += await this.generate_xml_program(channelid, start, stop, title, description, logo, this.convertStringToAirDate(cache_data.dates[0].date))
|
|
2792
|
+
this.debuglog('getTVData completed MASN')
|
|
2793
|
+
} // end includeTeams check
|
|
2794
|
+
} // end mediaType check
|
|
2795
|
+
} // end entitlements check
|
|
2796
|
+
} catch (e) {
|
|
2797
|
+
this.debuglog('getTVData MASN detect error : ' + e.message)
|
|
2798
|
+
}
|
|
2799
|
+
|
|
2766
2800
|
// MLB Network live stream for eligible USA subscribers
|
|
2767
2801
|
try {
|
|
2768
2802
|
if ( (entitlements.includes('MLBN') || entitlements.includes('EXECMLB') || entitlements.includes('MLBTVMLBNADOBEPASS')) ) {
|
|
@@ -2849,7 +2883,7 @@ class sessionClass {
|
|
|
2849
2883
|
let start = this.convertDateToXMLTV(new Date(cache_data.dates[0].date + ' 00:00:00'))
|
|
2850
2884
|
let stop = this.convertDateToXMLTV(new Date(cache_data.dates[cache_data.dates.length-1].date + ' 00:00:00'))
|
|
2851
2885
|
|
|
2852
|
-
//
|
|
2886
|
+
// SNY guide XML
|
|
2853
2887
|
programs += await this.generate_xml_program(channelid, start, stop, title, description, logo, this.convertStringToAirDate(cache_data.dates[0].date))
|
|
2854
2888
|
this.debuglog('getTVData completed SNY')
|
|
2855
2889
|
} // end includeTeams check
|
|
@@ -3847,6 +3881,8 @@ class sessionClass {
|
|
|
3847
3881
|
let dateString = eventName.substring(12)
|
|
3848
3882
|
this.debuglog('getEventStreamURL RecapRundown for ' + dateString)
|
|
3849
3883
|
playbackURL = await this.getRecapRundownURL(dateString)
|
|
3884
|
+
} else if ( eventName.toUpperCase() == 'MASN' ) {
|
|
3885
|
+
playbackURL = await this.getLinearStreamURL('MASN_ONE_LIVE')
|
|
3850
3886
|
} else if ( eventName.toUpperCase() == 'MLBN' ) {
|
|
3851
3887
|
playbackURL = 'https://falcon.mlbinfra.com/api/v1/linear/mlbn'
|
|
3852
3888
|
} else if ( eventName.toUpperCase() == 'SNLA' ) {
|