Announces gameplay for a live NBA game using ESPN's Play-by-Play Data
Explore the docs »
Report Bug
·
Request Feature
When one does not have access to live sports, when the game is not streamed on live TV, what does one do? This project was born to give a way to keep up with the game without access or attention requirements.
As plays are received by the url request, new plays are detected and read aloud. New quarters are also detected.
Note: Up to the last 15 plays will be read when starting the script for an existing game. After that, plays are read as they come in through the request.
To get a local copy up and running follow these simple steps.
This project assumes you have python installed.
- Clone the repo
git clone https://github.com/bay1877/NBA_ESPN_PlayByPlay_Announcer.git
- Enter the repo directory
cd NBA_ESPN_PlayByPlay_Announcer
- Setup and enter the virtual environment.
python3 -m venv venv source ./venv/bin/activate
- Install Python packages
pip install -r requirements.txt
Different operating systems use different command line mp3/audio players. TTS.py currently supports MacOS; change os.system("afplay *")
calls to match your OS.
Use afplay
.
Try mpg123
.
Use linux.
The above capture was taken from the following game: https://www.espn.com/nba/playbyplay/_/gameId/401332963. |
For the game you want to listen to, select the gamecast for a live game, and then select Play-by-Play. This is the link that you will pass into the script as a runtime argument. It should be in the following format where n is the unique game Id given by ESPN.
https://www.espn.com/nba/playbyplay/_/gameId/n
Also note the current quarter of the game.
With the link and the current quarter, run the script with the below. Make sure to source the venv before running the script, and deactivate it when you are finished.
source venv/bin/activate
...
python run.py <espn play by play url> <quarter #>
...
deactivate
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Bradley Yoder - [email protected]
Project Link: https://github.com/bay1877/NBA_ESPN_PlayByPlay_Announcer