feat(examples): add bot-bigbuckbunny video reply example#1778
Merged
Conversation
Bot that replies to any message with a video (Big Buck Bunny by default, overridable via -url). Demonstrates a multi-connection upload pool fed to the uploader, throttled INFO progress logging with upload speed, and a TTY-aware colored summary. Optional ffmpeg integration via github.com/ernado/ff: probes dimensions/duration, derives MIME from the container format, generates a thumbnail, and can cut (-cut) and/or size-compress (-max-size) the video before upload. All ffmpeg steps are best-effort and skipped with a warning when ffmpeg/ffprobe are unavailable. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1778 +/- ##
=======================================
Coverage 71.24% 71.24%
=======================================
Files 503 503
Lines 23593 23593
=======================================
Hits 16809 16809
Misses 5551 5551
Partials 1233 1233 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
examples/bot-bigbuckbunnyexample: a bot that replies to any incoming message with a video (Big Buck Bunny by default, overridable via-url).It demonstrates:
client.Pool(N)fed to the uploader, withuploader.WithThreads(N)so part uploads fan out across the sub-connections.-pool=falsefalls back to the main connection for comparison.uploader.Progressthat logs at INFO throttled to every 5s, including instantaneous and average upload speed.Optional ffmpeg integration (via
github.com/ernado/ff)Best-effort; skipped with a warning when
ffmpeg/ffprobeare not inPATH:Resolution/Duration).-cut <dur>trims the video (ffmpeg-t; lossless stream copy when not also compressing).-max-size <MB>re-encodes to approximately fit a size budget (target bitrate derived from size and the possibly-cut duration; skipped when the source already fits).Notes
ernado/ff+ transitive OTel/sdk) land only in theexamplesmodule'sgo.mod/go.sum, not the coretdmodule.-max-sizeis single-pass-b:vtargeting, so output size is approximate.Test plan
go build ./bot-bigbuckbunny/,go vet, andgofmt -lall clean.BOT_TOKEN/APP_ID/APP_HASH, run, message the bot; verify video reply, progress logs, and summary.🤖 Generated with Claude Code