Commit graph

2 commits

Author SHA1 Message Date
719946b3cd refactor/package-layout (#3)
All checks were successful
CI / backend-tests (push) Successful in 29s
CI / frontend-build (push) Successful in 9m48s
Reviewed-on: #3
Co-authored-by: pedro-bento <mail@pbento.pt>
Co-committed-by: pedro-bento <mail@pbento.pt>
2026-10-04 20:47:12 +01:00
juancarlos.cavero
ff2fd1005e fix(gemini): upload the source by handle, not by path
Handed a path, the SDK copies os.path.basename(path) verbatim into the
X-Goog-Upload-File-Name header, and httpx encodes header values as ASCII.
The downloaded file is named after the video's title, so every source
titled in Japanese, Cyrillic, Arabic or Greek died with "'ascii' codec
can't encode characters in position 0-4" before a byte left the
container, on the three stages that upload the whole file: the
silent-footage vision pass, the screencast detector and the AI editor.
The user saw "the AI model did not return usable clips for this video".

gemini_worker.upload_media() passes an open handle instead, which skips
that header; the readable name still travels as display_name, in the
JSON body, which is UTF-8. An extension the stdlib cannot place falls
back to video/mp4 rather than reaching the API as octet-stream.

The test reproduces the failure through the SDK's own header building
and httpx, and fails if a new call site uses files.upload directly.
2026-09-21 03:56:59 +02:00