Skip to content

Conversation

@mtsz-pl
Copy link

@mtsz-pl mtsz-pl commented Nov 19, 2025

Add support for RedGifs videos embedded in Reddit posts. Videos are proxied through redlib for privacy, similar to v.redd.it handling.

Features:

  • Detect RedGifs posts and proxy videos through /redgifs/ endpoint
  • Two-step flow: video ID lookup via API, then proxy video file
  • Token caching with 24h expiry for RedGifs API authentication
  • Prefer HD quality, fallback to SD automatically
  • Lazy loading with preload="metadata" to save bandwidth

Security:

  • Strict domain validation (only legitimate redgifs.com domains)
  • File extension validation (only .mp4 files)
  • Query parameter stripping from video IDs
  • Pattern matching for all versioned CDN subdomains (v1, v2, etc.)

Implementation:

  • New redgifs module with API integration
  • Reuses existing proxy infrastructure
  • Domain validation helper for consistent security checks

Fixes #20

Add support for RedGifs videos embedded in Reddit posts. Videos are
proxied through redlib for privacy, similar to v.redd.it handling.

Features:
- Detect RedGifs posts and proxy videos through /redgifs/ endpoint
- Two-step flow: video ID lookup via API, then proxy video file
- Token caching with 24h expiry for RedGifs API authentication
- Prefer HD quality, fallback to SD automatically
- Lazy loading with preload="none" to save bandwidth

Security:
- Strict domain validation (only legitimate redgifs.com domains)
- File extension validation (only .mp4 files)
- Query parameter stripping from video IDs
- Pattern matching for all versioned CDN subdomains (v1, v2, etc.)

Implementation:
- New redgifs module with API integration
- Reuses existing proxy infrastructure
- Domain validation helper for consistent security checks
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.

💡 Feature request: redgifs support

1 participant