Game Film Import Service for a Sports Video Platform
A REST service that takes a team-video link from HUDL, VEO, Trace or Pixellot, downloads the game and lands it in the client's S3 bucket, in the path pattern their processing pipeline already expects.
The problem
A sports video platform wanted players to bring their game film into their profiles without anyone downloading and re-uploading files by hand. The film sat on five different team-video platforms, each with its own login, link style and quirks, and it had to arrive in the client's S3 bucket under the exact path pattern their existing pipeline already picks up.
How I built it
I built one FastAPI service with a separate extractor per platform behind a single endpoint: the client's site posts a link, gets a job id, polls for progress and receives the S3 location, with a webhook on completion. HUDL and Pixellot sign in through a headless browser with the player's own account, Trace uses its emailed-code login, VEO and YouTube go through yt-dlp, and FFmpeg handles the download and muxing before the upload. Before writing code I reviewed the client's own API spec and sent back what it needed, including a verify call for Trace's two-step login, a status endpoint for polling, a callback URL and the game data fields. Everything was proven against their staging bucket first, then shipped as a docker-compose deploy with Swagger docs, and it runs on the client's own server.
What got hard
- HUDL imports passed testing, then started failing for one team with an access error, even though the same link and account downloaded fine from my own machine in about two seconds.
That gap pointed at the server, not the account. The login code kept one shared session file and returned whichever HUDL account had signed in last, so the wrong identity opened the team. I reproduced the exact production error in a controlled test (sign in as account A, then request account B's team), then gave every account its own session.
- Team film links from HUDL stopped giving a video stream at all. A link that looked like one game was actually dozens of separate per-play clips (46 on the one I probed), so imports reported success and then showed a re-upload prompt on the client's side.
I read the ordered clip list, downloaded the plays in parallel with retries, gave each clip exactly one audio track and joined them without re-encoding. A 42-play reel mixed two video timescales, which stretched 17 minutes of video over 73 in the joined file while the frame count still matched, so every clip now goes onto one timescale and the join is checked by where its last frame lands, not just by frame count. Real runs through the import API produced a 231.7 second and a 1,040.5 second game, and both passed the join check.
- Trace signs players in with a six digit code sent by email, and entering the code made Trace issue a new one, so verification timed out every time.
The verify step reopened a browser and resubmitted the email, which cancelled the code the player had just received. Saving the browser session did not hold the pending login, so I rebuilt the sign-in as three stateless calls (find the user, send the code, submit the code). Submitting a code no longer touches the email step, and a wrong code returns Trace's own error instead of quietly generating a new one.
- A batch of 8 games took about 11.4 hours to land in the bucket, and one game was still running after 8.5 hours when the client asked about it.
I read the client's bucket (read only) instead of guessing. None of the 75 imports I checked carried the signature of the optional re-encode step having finished, so every job waited out that step's time limit before uploading the original file, three at a time. Their pipeline re-encodes every upload anyway, so the fix was a single setting that turns the step off, and I sent their developer the diagnosis and the exact change.
- HUDL imports arrived with no game date, and opponent names carried a trailing 'Varsity Soccer' style label.
The importer only read the date from the video title, and the titles had none. I asked HUDL for the broadcast's own start time, converted it from UTC to the calendar date in the game's time zone, and trimmed the gender, level and sport label off team names. A date written in the title still wins, and a failed lookup leaves the date blank instead of failing the import.
- On 11 November a VEO import failed with HTTP 403 on its download step, right after the first step had read the match title without any trouble.
One failure could not separate a changed header set from the repeat call to VEO's match API, so I removed both suspects: the download step now reuses the file list the first step already read, VEO's match API is called once, and yt-dlp still picks the same file it picked before (checked offline against its own selector). The patch ships with a deploy guide whose first step saves the job history. It was tested on our side only, and confirmation from the client's server was still pending when this was written.
The result
HUDL, VEO, Trace and Pixellot imports went live for the client in the months after the 5 May 2026 delivery, and the service has kept growing with team-film links, HUDL dates and a VEO download patch added since. YouTube links are supported in the code but were not completed on the client's server.
The ← and → keys turn the page too.