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
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:
- Viewport Analysis - Calculates which video is most visible
- Size Scoring - Prioritizes larger, main content videos
- Position Weighting - Favors videos near the center of screen
- 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.