Skip to content

Upload the best fitting video variant - #24

Merged
itsreverence merged 1 commit into
masterfrom
codex/adaptive-video-uploads
Jul 23, 2026
Merged

Upload the best fitting video variant#24
itsreverence merged 1 commit into
masterfrom
codex/adaptive-video-uploads

Conversation

@itsreverence

Copy link
Copy Markdown
Owner

What changed

  • preserve all playable MP4 variants discovered from X network and syndication data
  • preflight video sizes and upload the highest-quality variant that fits
  • enforce a safe 24 MiB total multipart attachment budget
  • fall back through smaller variants before exposing the existing CDN-link fallback
  • keep successful lower-variant uploads clean, without a visible video CDN URL
  • report whether fallback media was too large or failed to download
  • bump the release version to 0.6.30 and rebuild the userscript

Why

The previous fixed 8 MiB per-file limit rejected the referenced 15.3 MB video after downloading it, even though it fits Discord's current request allowance. It also discarded the smaller MP4 variants that could have served as fallback choices.

User impact

Video shares now prefer the clean native Discord player. The userscript tries the best fitting X-hosted MP4 variant automatically and only displays a CDN fallback link when no variant can be uploaded.

Validation

  • npm test — 98 tests passed
  • npm run check
  • git diff --check
  • regression coverage for the reported 15.3 MB video
  • oversized highest-quality variant fallback
  • failed HEAD fallback to bounded downloads
  • combined multipart request budget
  • end-to-end assertion that lower-variant uploads do not expose CDN links

Trust and release impact

  • no webhook, storage, grant, or connected-host changes
  • network behavior adds bounded HEAD requests to the already-allowed X video CDN before media downloads
  • generated userscript updated from source
  • merging publishes v0.6.30 through the existing release workflow

@itsreverence
itsreverence merged commit 12cf333 into master Jul 23, 2026
3 checks passed
@itsreverence
itsreverence deleted the codex/adaptive-video-uploads branch July 23, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant