The purpose of this is to programmatically download videos of events from a player's statcast ID, and then grab corresponding event "metadata", e.g. date, exit velocity, launch angle, xwOBA, etc. to then use in video editing software.
Go to config.py and
- enter the desired player's statcast ID, e.g.
player_id = '694192'
- this can be found in the URL of a player's statcast page, or, alternatively, you can grab this using pybaseball's playerid_lookup
- enter the desired start season and end season, e.g.
start_season = '2024'
(#TODO this doesn't work yet) - enter the team abbreviation of the player for that season to grab the correct broadcast, e.g.
team_abbr = 'MIL'
- if this is left blank or filled in incorrectly, videos downloaded may be from incorrect broadcast
- enter the desired statcast events that you want to download the videos of
Once configured, run main.
- the videos will be saved to a folder in the working directory titled
[player_id]_videos
and videos will be titled `[chronological_index_of_event]_[player_id].mp4' - a CSV of statcast data for each event that is downloaded, including a column matching the name of the video so it's easier to process in video editor down the line
- ability to download multiple seasons at once
- take desired "metadata" columns as input