RedGifs Copy Video Embed Link & Download

Content-aware copy button with video change detection, visual feedback, robust homepage support, enhanced download UI with beautiful hover menu, niches support, and search page support

ئاپتورى
Monk Key3
بۈگۈن قاچىلانغىنى
0
جەمئىي قاچىلانغىنى
32
باھا نومۇرى
1 0 0
نەشرى
5.7
قۇرۇلغان ۋاقتى
2025-06-16
يېڭىلانغان ۋاقتى
2025-07-04
Size
59.6 KB
ئىجازەتنامىسى
MIT
قوللايدىغىنى

RedGifs RedGifs Copy Video Embed Link

Click "Copy Video" to get the direct URL

A powerful userscript that adds a smart copy button to RedGifs for getting direct, embeddable video URLs that work with Discord and other platforms.

  • Works on all RedGifs pages: homepage, user profiles, watch pages
  • Intelligently prioritizes the most prominent video in your viewport
  • No longer relies on URL-based detection

🔄 Dynamic Video Tracking

  • Real-time detection as you scroll through video feeds
  • Visual highlight notification when a new video is detected
  • Seamless support for infinite scroll and SPA navigation
  • Works perfectly on user profile pages (/users/username)

🔐 API Authentication

  • Automatically extracts and manages RedGifs bearer tokens
  • Handles token expiration and renewal
  • Gets valid signed URLs that work for 1 hour
  • Bypasses RedGifs' anti-hotlinking protection

  • Minimal, non-intrusive interface

Supported URLs

https://redgifs.com/*
https://www.redgifs.com/*

💡 How It Works

Smart Video Detection

The script uses advanced algorithms to identify the currently active video:

  1. Viewport Analysis - Calculates which video is most visible
  2. Size Scoring - Prioritizes larger, main content videos
  3. Position Weighting - Favors videos near the center of screen
  4. Context Extraction - Analyzes surrounding DOM for video metadata

API Integration

// Automatically handles RedGifs API authentication
const signedUrl = await getSignedUrl(videoId);
// Returns: https://files.redgifs.com/VideoId.mp4?token=...&expires=...

Real-Time Monitoring

  • Intersection Observer - Tracks video visibility changes
  • Mutation Observer - Detects new videos being loaded
  • Scroll Handler - Updates active video as you browse
  • URL Watcher - Handles SPA navigation

Visual Feedback

  • Blue Highlight - New video detected
  • Green Success - URL copied successfully (valid for 1 hour)
  • Red Error - Copy failed or authentication error
  • Gray Loading - Processing API request

🔧 Troubleshooting

Common Issues

Button Not Appearing

  • Ensure Tampermonkey is enabled for RedGifs
  • Check that the script is active in Tampermonkey dashboard
  • Refresh the page after installation

"Auth Failed" Error

// The script will automatically retry token extraction
// If persistent, try refreshing the page

"No Video Detected" Error

  • Scroll to make sure a video is prominently visible
  • The video needs to be at least 200px wide to be detected
  • Try clicking on a video to make it active

Copy Failed

  • Ensure your browser supports the Clipboard API
  • Try using Ctrl+V to paste - the fallback method may have worked
  • Check browser permissions for clipboard access

Debug Mode

Enable console logging to see detailed operation:

// Open browser DevTools (F12) to see debug messages
console.log('Video detected:', videoId);
console.log('API response:', signedUrl);

This script is not affiliated with RedGifs. It's a community-made tool to enhance user experience.