MLB.TV for Channels

please do let me know if there are any issues, but also keep in mind that i do have a day job and it may take some time for me to fix them.

STANDARD DISCLAIMER: you must have valid MLB login credentials to use this package. this will not get you any games for free (aside from the free game of the day, see below), and will absolutely not work without valid MLB login credentials. also, blackout rules apply to all games - for both any teams in your local geographical area, as well as any national exclusive games (i.e. ESPN and sunday night baseball in the US).

SUPPORT FOR ATTEMPTING TO BYPASS BLACKOUT RESTRICTIONS IS NOT AND WILL NOT BE PROVIDED.

as mentioned above, you can use this package with valid MLB login credentials to watch the free game of the day, if you do not have an active MLB TV subscription. the free game of the day will be indicated in the guide, and attempts to access any other game without a valid subscription will show an error message on screen that you are not entitled to view that game. BLACKOUT RULES STILL APPLY TO THE FREE GAME OF THE DAY.


docker run command:

docker run \
       -p 8080:8080 --name channels-baseball \
       -v storage_app:/var/www/html/storage/app \
       -v storage_logs:/var/www/html/storage/logs \
       -e APP_URL='http://server.ip:8080' \
       -e MLB_USERNAME='xxx' -e MLB_PASSWORD='xxx' \
       -e MLB_PLAYLIST_FIRST_CHANNEL='777' \
       -e MLB_TEAM_ORDER='NYM,SDP,PIT,LAA,ATL,MIA,PHI,WAS,CHC,CIN,MIL,STL,ARI,COL,LAD,SFG,BAL,BOS,NYY,TBR,TOR,CWS,CLE,DET,KCR,MIN,HOU,OAK,SEA,TEX,MLB' \
       -e MLB_BITRATE='5600' \
       -e MLB_TIMEZONE='America/Los_Angeles' \
       -e MLB_SHOW_TV_FEEDS=true \
       -e MLB_SHOW_RADIO_FEEDS=false \
       matty8199/channels-baseball:latest

docker-compose.yml

version: "2"
services:
  channels-baseball:
    image: matty8199/channels-baseball:latest
    container_name: channels-baseball
    environment:
      - APP_URL='http://server.ip.goes.here:8080'
      - LOG_LEVEL='warning'
      - MLB_USERNAME=''
      - MLB_PASSWORD=''
      - MLB_BITRATE='5600'
      - MLB_PLAYLIST_FIRST_CHANNEL='777'
      - MLB_TEAM_ORDER='NYM,SDP,PIT,LAA,ATL,MIA,PHI,WAS,CHC,CIN,MIL,STL,ARI,COL,LAD,SFG,BAL,BOS,NYY,TBR,TOR,CWS,CLE,DET,KCR,MIN,HOU,OAK,SEA,TEX,MLB'
      - MLB_TIMEZONE='America/Los_Angeles'
      - MLB_SHOW_TV_FEEDS=true
      - MLB_SHOW_RADIO_FEEDS=false
    ports:
      - 8080:8080
    volumes:
      - storage_app:/var/www/html/storage/app
      - storage_logs:/var/www/html/storage/logs
volumes:
  storage_app:
  storage_logs:

the MLB_USERNAME and MLB_PASSWORD env vars above are both obviously required. put your valid MLB credentials into these two slots.

the other required environment var is APP_URL, which needs to be set to your server's IP and port 8080. so, for example, if you're running this on IP 192.168.1.100, then that env should be set as follows:

APP_URL='http://192.168.1.100:8080'

if you have another service on your machine at port 8080, you can change this port - just make sure you change it in all applicable locations (both in your docker run command / docker-compose config, as well as in the channels m3u config). if you do this, make sure you are only changing the host port (the container port must stay as 8080, as that's the port the container expects requests to come in on).

the other env vars you see there are pretty self-explanatory BUT all have default values if you don't specify them. i'll give a quick rundown here of what they do, though...

MLB_PLAYLIST_FIRST_CHANNEL

  • the first channel in the playlist (i.e. the channel number where your MLB section will start in the guide). defaults to 20000, unless you specify otherwise. in my example, i used 777 because i wanted an easy triple tap number to get to the beginning of the list.

LOG_LEVEL

  • exactly what you'd expect: defines how much information the logs will show. i would set this to warning initially to avoid a huge log file, but we may need to adjust if there are any issues that i need more detailed logs on.

MLB_TIMEZONE

  • i almost wanted to say this is required, but technically it's not. if you don't set this, things should still work as far as watching games...but the guide data will be way off. if you don't specify a timezone here, the app will default to UTC.

example USA timezone values for this variable (just enter the America/xxx or Pacific/xxx part of the timezone below into the env spot in the docker-compose file, leave out the parenthetical timezone name):

America/New_York (eastern)
America/Chicago (central)
America/Denver (mountain w/ DST)
America/Phoenix (mountain standard, no DST)
America/Los_Angeles (pacific)
America/Anchorage (alaska)
Pacific/Honolulu (hawaii)
  • in my example docker-compose file above, you can see i'm defaulting to pacific time

MLB_BITRATE

  • the default bitrate / video quality, defaults to 720p @ 60 fps (5600)

  • available options are (just enter the number only in the env section of the docker-compose file):

    5600 (720p @ 60 fps)
    3500 (720p)
    2500 (540p)
    1800 (504p)
    1200 (360p)
    800 (288p)
    514 (216p)
    192 (180p)
    
  • all options are in Kbps (ie. 5600 = 5600K) and are 30 fps unless otherwise specified

  • the following example would default to 720p, 30fps:

    MLB_BITRATE='3500'
    

MLB_TEAM_ORDER

  • the order you want the teams to appear in the guide (will start from the first channel variable and increment one at a time in the order you specify here). if there are teams that are blacked out in your area and you want to exclude those teams, you can just remove them from the list here.

  • the MLB Big Inning feed can be added by including MLB as a team short code somewhere in this list (remove MLB from the list if you don't want the Big Inning feed included)

MLB_SHOW_TV_FEEDS
MLB_SHOW_RADIO_FEEDS
  • these two environment variables can be set to true or false to turn the TV and/or radio feeds on or off

once you do that, follow the steps to add a custom m3u in channels:

  • the stream format is HLS,
  • source is URL,
    http://server.ip:8080/m3u
  • options you can set as you see fit, but this m3u won't change unless you recreate the container and change the team order (so you can probably just leave this set to never refresh). you can either set it to use your channel numbers or let channels pick them, shouldn't matter either way.
  • xml guide URL is http://server.ip:8080/epg and i have mine set to refresh every hour (MLB updates their metadata almost immediately after games end or are postponed, so we want to refresh the guide as often as possible)

my venmo is @crackers8199 if anyone wants to buy me a beer or make a small donation. it's certainly not required, but a few kind users have messaged me privately recently asking if there's a way to donate, so i figured i'd add it here.

7 Likes

any thoughts on unraid setup for this? thanks for your work

My Unraid config looks like this and is working great.

2 Likes

Does this attempt to resolve your geographic location for blackouts?

1 Like

Yep, that’s done on the MLB server side, no way that it can be coded around (not that @crackers8199 would want to even if he could)

2 Likes

this works great thanks - trying to get a passthrough network config working now

yup, when you try to load a game MLB will resolve your location and either load or not load the stream for you. if you're in a blackout region, you'll see a message on screen telling you that the game is unavailable due to blackout restrictions.

Can we get something like this to help with running the command correctly: https://github.com/maddox/pluto-for-channels/blob/main/README.md

2 Likes

the syntax you need for the run command is up in the first post in this thread. you can use the run command or docker-compose, either one will work. all of the env vars and what they do are in that post as well.

i can work on putting together a readme, but it's just going to be the same information that's already there above...

35 posts were split to a new topic: Docker help needed for MLB.TV for Channels

works great on synology docker. no issues so far.

glad i released this just in time for everyone to watch that no-hitter tonight!

2 Likes

Thank you for this release - resolved my issues - working great and video resolves very quickly

1 Like

Sorry for noob questions. I've read of docker, never installed it. New to Channels, too, but becoming a quick convert.

Docker in this case does NOT run on the Channels unit (I'm using a Pi model 4), right? A linux or windows box that needs to stay running?

1 Like

you can run it on the same server you're running channels on, but you don't have to. whatever machine you run it on does need to be on all the time, of course...and if you're going to use a new box for it, i'd strongly recommend linux. docker on windows works, but in my experience is way more complicated to set up and keep running than on linux. on linux it just works...

1 Like

I’d never used Docker before and had no idea how to use it. But then I found Docker Desktop, which made it pretty easy. I’m using it on a Mac that is also my Channels DVR, and it’s integrating channels from Pluto TV and Stirr and MLB at Bat. All via threads I read here.

3 Likes

This topic is for the MLB project. For help with basic usage of docker, please create another topic or use one of the many many tutorials found online.

4 Likes

So in order to use MLB.tv you have to set up docker? Is there an easier implementation in the works?

1 Like

i'm not sure what would be considered an "easier" implementation...docker is pretty damn easy to get set up and running, even if you have limited or no experience with it.

2 Likes