Terabox video link unlock (redirect to embed)

Redirect Terabox video links to embed links

  1. // ==UserScript==
  2. // @name Terabox video link unlock (redirect to embed)
  3. // @author Rust1667
  4. // @version 1.1
  5. // @description Redirect Terabox video links to embed links
  6. // @match https://*.terabox.com/*
  7. // @match https://*.mirrobox.com/*
  8. // @match https://*.nephobox.com/*
  9. // @match https://*.freeterabox.com/*
  10. // @match https://*.1024tera.com/*
  11. // @match https://*.4funbox.co/*
  12. // @match https://*.4funbox.com/*
  13. // @match https://*.terabox.app/*
  14. // @match https://*.terabox.fun/*
  15. // @match https://*.momerybox.com/*
  16. // @match https://*.teraboxapp.com/*
  17. // @match https://*.tibibox.com/*
  18. // @match https://*.gibibox.com/*
  19. // @grant none
  20. // @namespace https://greasyfork.org/users/980489
  21. // ==/UserScript==
  22.  
  23. (function() {
  24. 'use strict';
  25.  
  26. // Video file extensions to check
  27. const videoExtensions = [
  28. '.mp4', '.avi', '.mkv', '.mov', '.wmv', '.flv', '.webm',
  29. '.m4v', '.mpg', '.mpeg', '.mp2', '.mpe', '.ogv', '.3gp'
  30. ];
  31.  
  32. // Check if the current URL is a sharing link and page title contains a video extension
  33. if (window.location.href.includes('/sharing/link?')) {
  34. // Check if document title contains any video extension
  35. const hasVideoExtension = videoExtensions.some(ext =>
  36. document.title.toLowerCase().includes(ext.toLowerCase())
  37. );
  38.  
  39. // Redirect only if a video extension is found
  40. if (hasVideoExtension) {
  41. window.location.assign(window.location.href.replace('/sharing/link?', '/sharing/embed?'));
  42. }
  43. }
  44. })();