Releases: DeadShot472/Universal-Embed-Player
Releases · DeadShot472/Universal-Embed-Player
Release list
G.O.A.T for Telegram v2.5.0
Release v2.5.0: The iTeraPlay Update
This release upgrades our primary embedding engine to iTeraPlay 2025, ensuring better compatibility with recent TeraBox link formats and faster buffer times.
🛠 What’s Changed
- New Primary Player: Switched
METHOD_1to the iTeraPlay API. This provides a more stable player environment and bypasses recent playback restrictions. - API Key Integration: Integrated the
iTeraPlay2025authentication key directly into the embedding logic for seamless access.
G.O.A.T for Telegram v2.0
GitHub Release Notes
Version 2.0: Major Update
-
What's New:
- Added support for multiple embedding methods.
- Implemented auto-detection of the best embedding method based on latency.
- Introduced a modernized dropdown UI for embedding method selection.
- Enhanced logging with timestamps and context.
- Improved error handling and fallback mechanisms.
- Cached allowed domains and best embedding method for better performance.
- Added detailed comments and documentation for maintainability.
-
Bug Fixes:
- Fixed potential issues with invalid URLs.
- Ensured proper cleanup of previous UI elements to avoid duplicates.
-
Performance Improvements:
- Reduced redundant network requests by caching allowed domains.
- Added timeouts for embedding method detection to prevent hanging.
-
Known Issues:
- Some embedding methods may not support CORS, leading to fallback behavior.
Summary of Changes
| Feature/Area | Version 1.0 | Version 2.0 |
|---|---|---|
| Modularization | Single block of code | Split into Config, Logger, Embedding, Event Handling, and Auto-Detection |
| Embedding Methods | Single hardcoded URL | Multiple methods with dynamic switching |
| Auto-Detection | Not available | Added auto-detection of the best embedding method |
| Logging | Basic logs | Enhanced logs with timestamps and context |
| Dropdown UI | Not available | Added dynamic, styled dropdown for embedding method selection |
| Caching | No caching | Cached allowed domains and best embedding method |
| Error Handling | Basic | Comprehensive error handling for all critical operations |
| Fallback Mechanism | Not available | Added fallbacks for embedding failures and auto-detection |
| Performance | Limited | Added timeouts and caching for improved performance |
| User Experience | Minimal focus | Added loading indicators, modern UI, and usability improvements |
| Code Quality | Functional but unstructured | Well-organized, readable, and documented |
Full Changelog: https://github.com/DeadShot472/Universal-Embed-Player/commits/goat_for_telegram_v2.0
G.O.A.T for Telegram v.1.0
G.O.A.T for Telegram - Change Log
v1.0
Major Updates:
- Centralized Allowed Domains Handling:
- Replaced hardcoded domain list with dynamic JSON fetch.
- Scoped Execution to Telegram Web Only:
- Limited script scope to
web.telegram.orgfor performance.
- Limited script scope to
- Enhanced Event Handling:
- Prevented conflicts with Telegram’s native event handlers.
- Improved Media Container Selection:
- More reliable media container identification.
- Permissions Update:
- Added permission for
GM_xmlhttpRequestto fetch domains.
- Added permission for
- Better Error Handling and Logging:
- Enhanced logging for debugging.
Key Changes:
- Domains fetched from external GitHub JSON.
- Permissions for network requests.
- Execution scoped to
web.telegram.org.
Univeresal Embed Player v2.3
Key Features
-
Dynamic Video Embedding:
- Link Detection: The script listens for click events on the page. When you click on a link (or an element containing a link), it inspects the URL in the
href, any visible text that looks like a URL, or even parameters within the URL (likeurl,target, etc.). - Domain Verification: By default, it checks whether the URL’s domain is allowed before embedding. It does this by comparing against a list of approved domains.
- Force Embedding Mode: There is an option to bypass the domain check. When this mode is enabled, the script will attempt to embed the video regardless of its domain.
- Link Detection: The script listens for click events on the page. When you click on a link (or an element containing a link), it inspects the URL in the
-
Configurable Allowed Domains:
- Remote Configuration: It fetches a JSON configuration file from GitHub that lists allowed domains. If fetching or parsing fails, it falls back to a default list (e.g.,
terabox.com,example.com). - Local Override: You can toggle Force Embedding Mode which ignores the allowed domain restrictions.
- Remote Configuration: It fetches a JSON configuration file from GitHub that lists allowed domains. If fetching or parsing fails, it falls back to a default list (e.g.,
-
Embedding Mechanism:
- Embed Code Generation: When a valid video link is detected, the script creates an HTML snippet that includes a resizable container and an
<iframe>. This<iframe>points to a URL built by appending the encoded video URL to a base URL (https://terabox-watch.netlify.app/api2.html?url=), which likely processes or plays the video. - Responsive Sizing: It calculates the optimal player size (defaulting to a 700px width and a 16:9 aspect ratio) based on the size of the parent container.
- Embed Code Generation: When a valid video link is detected, the script creates an HTML snippet that includes a resizable container and an
-
Interactive Resizing and Overlay:
- Resizable Container: The embedded player is placed inside a container that can be resized by dragging. During resizing, an overlay is temporarily shown to block interactions, ensuring a smooth resizing experience.
-
User Interface for Settings:
- Settings Panel: A small, circular icon is added to the bottom-right corner of the page. This icon acts as a toggle for the Force Embedding Mode.
- Icon & Color Indication: The icon changes between two symbols (⚡ for enabled and 💀 for disabled) and its color changes (yellow for active, red for inactive) to indicate the current mode.
- Toggle Functionality: Clicking the icon toggles the Force Embedding Mode, stores the state in
localStorage, and shows a brief on-screen notification (toast) to inform you of the change.
- Settings Panel: A small, circular icon is added to the bottom-right corner of the page. This icon acts as a toggle for the Force Embedding Mode.
-
Notifications and Logging:
- Toast Messages: The script shows temporary on-screen messages (toasts) to notify you of events such as errors, successful embeddings, or changes in mode.
- Console Logging: It logs key actions and decisions (like domain checks and errors) to the browser console for debugging purposes.
G.O.A.T for Telegram v1.4
Updates: v1.0 → v1.4
📌 Note : Only optimized for https://web.telegram.org/a/ version !
1️⃣ Caching for Allowed Domains
- v1.0: Fetched the allowed domains list from GitHub every time the script ran, making it slower and network-dependent.
- v1.4: Now uses
localStorageto cache domains for 24 hours, ensuring faster loads, offline support, and reduced API calls.
2️⃣ Dynamic Content Handling
- v1.0: Only handled existing links on the page, failing for dynamically loaded messages in Telegram chats.
- v1.4: Implements
MutationObserverto detect new messages and process them seamlessly with real-time updates.
3️⃣ Efficient Event Delegation
- v1.0: Listened for clicks on all
<a>tags, causing potential conflicts with Telegram’s native handlers. - v1.4: Now targets specific selectors (
a.anchor-url[href*="terabox"]) and delegates events todocument.bodyfor improved efficiency.
4️⃣ Better Error Handling & User Feedback
- v1.0: Minimal error logging and no visual feedback for users when embeds failed.
- v1.4: Introduced loading indicators and error messages (e.g., "Player load failed") for a better user experience.
5️⃣ Improved Code Maintainability
- v1.0: Used nested promises and ad-hoc functions, making debugging difficult.
- v1.4: Now follows a modular structure, separating key functionalities:
- Caching (
fetchAllowedDomains,cacheDomains) - DOM Handling (
createEmbedFrame,handleMutations) - Utilities (
log,isAllowedDomain)
- Caching (
6️⃣ Performance Boost
- v1.0: Re-parsed the DOM for media containers on every click, causing lag in large chats.
- v1.4: Optimized performance by applying styles via
cssText, observing only.messages-container, and reducing DOM reflows.
7️⃣ Enhanced Security & URL Validation
- v1.0: Performed only basic domain checks for validation.
- v1.4: Implements strict URL validation (
try/catch,new URL()) and filters irrelevant links early.
8️⃣ Styling & UI Enhancements
- v1.0: Directly copied styles from the container.
- v1.4: Introduced custom CSS via
GM_addStyle, adding smooth transitions (e.g., iframeopacityfade-in) and better loading/error visuals.
🆕 Summary of Key Changes
| Feature | v1.0 | v1.4 |
|---|---|---|
| Caching | ❌ No | ✅ Yes |
| Dynamic content support | ❌ No | ✅ Yes |
| Error messages | ❌ No | ✅ Yes |
| Async/Await syntax | ❌ No | ✅ Yes |
| MutationObserver | ❌ No | ✅ Yes |
| LocalStorage usage | ❌ No | ✅ Yes |
| Sandboxed iframe | ❌ No | ✅ Yes |