mlbserver 2024.5.27 → 2024.6.26
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 +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/session.js +16 -12
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -127,7 +127,7 @@ var argv = minimist(process.argv, {
|
|
|
127
127
|
e: 'env'
|
|
128
128
|
},
|
|
129
129
|
boolean: ['ffmpeg_logging', 'debug', 'logout', 'session', 'cache', 'version', 'free', 'env'],
|
|
130
|
-
string: ['
|
|
130
|
+
string: ['account_username', 'account_password', 'zip_code', 'country', 'fav_teams', 'multiview_path', 'ffmpeg_path', 'ffmpeg_encoder', 'page_username', 'page_password', 'content_protect', 'data_directory']
|
|
131
131
|
})
|
|
132
132
|
|
|
133
133
|
if (argv.env) argv = process.env
|
package/package.json
CHANGED
package/session.js
CHANGED
|
@@ -2357,18 +2357,19 @@ class sessionClass {
|
|
|
2357
2357
|
} else {
|
|
2358
2358
|
for (var k = 0; k < cache_data.dates[i].games[j].broadcasts.length; k++) {
|
|
2359
2359
|
let team = cache_data.dates[i].games[j].teams['home'].team.abbreviation
|
|
2360
|
-
let team_id = cache_data.dates[i].games[j].teams['home'].team.id
|
|
2361
|
-
let opponent_team_id = cache_data.dates[i].games[j].teams['away'].team.id
|
|
2362
|
-
if ( team_ids.includes(opponent_team_id) && !team_ids.includes(team_id) ) {
|
|
2360
|
+
let team_id = cache_data.dates[i].games[j].teams['home'].team.id.toString()
|
|
2361
|
+
let opponent_team_id = cache_data.dates[i].games[j].teams['away'].team.id.toString()
|
|
2362
|
+
if ( team_ids.split(',').includes(opponent_team_id) && !team_ids.split(',').includes(team_id) ) {
|
|
2363
2363
|
team_id = opponent_team_id
|
|
2364
2364
|
team = cache_data.dates[i].games[j].teams['away'].team.abbreviation
|
|
2365
2365
|
}
|
|
2366
|
-
let
|
|
2367
|
-
let
|
|
2366
|
+
let sportId = cache_data.dates[i].games[j].teams['home'].team.sport.id
|
|
2367
|
+
let channelid = mediaType + '.' + sportId + '.' + team
|
|
2368
|
+
//let logo = server + '/image.svg?teamId=' + team_id
|
|
2369
|
+
let logo = 'https://img.mlbstatic.com/mlb-photos/image/upload/ar_167:215,c_crop/fl_relative,l_team:' + cache_data.dates[i].games[j].teams['home'].team.id + ':fill:spot.png,w_1.0,h_1,x_0.5,y_0,fl_no_overflow,e_distort:100p:0:200p:0:200p:100p:0:100p/fl_relative,l_team:' + cache_data.dates[i].games[j].teams['away'].team.id + ':logo:spot:current,w_0.38,x_-0.25,y_-0.16/fl_relative,l_team:' + cache_data.dates[i].games[j].teams['home'].team.id + ':logo:spot:current,w_0.38,x_0.25,y_0.16/w_750/team/' + cache_data.dates[i].games[j].teams['away'].team.id + '/fill/spot.png'
|
|
2368
2370
|
if ( this.protection.content_protect ) logo += '&content_protect=' + this.protection.content_protect
|
|
2369
2371
|
let streamMediaType = 'Video'
|
|
2370
2372
|
let stream = server + '/stream.m3u8?team=' + encodeURIComponent(team) + '&mediaType=' + streamMediaType
|
|
2371
|
-
let sportId = cache_data.dates[i].games[j].teams['home'].team.sport.id
|
|
2372
2373
|
stream += '&level=' + encodeURIComponent(this.getLevelNameFromSportId(sportId))
|
|
2373
2374
|
stream += '&resolution=' + resolution
|
|
2374
2375
|
if ( this.protection.content_protect ) stream += '&content_protect=' + this.protection.content_protect
|
|
@@ -3374,16 +3375,14 @@ class sessionClass {
|
|
|
3374
3375
|
let currentDate = new Date()
|
|
3375
3376
|
if ( !fs.existsSync(cache_file) || !this.cache || !this.cache.eventURLCacheExpiry || (currentDate > new Date(this.cache.eventURLCacheExpiry)) ) {
|
|
3376
3377
|
let reqObj = {
|
|
3377
|
-
|
|
3378
|
-
url: 'https://dapi.mlbinfra.com/v2/content/en-us/vsmcontents/mlb-tv-welcome-center-big-inning-show',
|
|
3378
|
+
url: 'https://dapi.cms.mlbinfra.com/v2/content/en-us/sel-mlbtv-featured-svod-video-list',
|
|
3379
|
+
//url: 'https://dapi.mlbinfra.com/v2/content/en-us/vsmcontents/mlb-tv-welcome-center-big-inning-show',
|
|
3379
3380
|
headers: {
|
|
3380
3381
|
'User-Agent': USER_AGENT,
|
|
3381
3382
|
'Origin': 'https://www.mlb.com',
|
|
3382
3383
|
'Referer': 'https://www.mlb.com',
|
|
3383
|
-
'Content-Type': 'application/json'
|
|
3384
|
-
|
|
3385
|
-
},
|
|
3386
|
-
gzip: true
|
|
3384
|
+
'Content-Type': 'application/json'
|
|
3385
|
+
}
|
|
3387
3386
|
}
|
|
3388
3387
|
var response = await this.httpGet(reqObj, false)
|
|
3389
3388
|
if ( response && this.isValidJson(response) ) {
|
|
@@ -4348,7 +4347,12 @@ class sessionClass {
|
|
|
4348
4347
|
' <title lang="en">' + title + '</title>' + "\n" +
|
|
4349
4348
|
' <desc lang="en">' + description.trim() + '</desc>' + "\n" +
|
|
4350
4349
|
' <category lang="en">Sports</category>' + "\n" +
|
|
4350
|
+
' <category lang="en">Baseball</category>' + "\n" +
|
|
4351
|
+
' <category lang="en">Sports event</category>' + "\n" +
|
|
4351
4352
|
' <icon src="' + icon + '"></icon>' + "\n" +
|
|
4353
|
+
' <new/>' + "\n" +
|
|
4354
|
+
' <live/>' + "\n" +
|
|
4355
|
+
' <sport>Baseball</sport>' + "\n" +
|
|
4352
4356
|
' </programme>'
|
|
4353
4357
|
}
|
|
4354
4358
|
|