EromeDL

Download videos from EROME with ease, bypassing download restrictions.

  1. // ==UserScript==
  2. // @name EromeDL
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.8
  5. // @description Download videos from EROME with ease, bypassing download restrictions.
  6. // @author BLOCKCHAIN021
  7. // @match https://*.erome.com/*
  8. // @grant GM_download
  9. // @grant GM_xmlhttpRequest
  10. // @icon https://simp6.jpg5.su/images3/Captura-de-tela-2024-12-28-225950f9d0bb2acb8ae452.png
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. /*
  15. * Aviso Legal:
  16. *
  17. * Este script é fornecido "no estado em que se encontra", sem garantias de qualquer tipo, expressas ou implícitas.
  18. * O uso deste script é de inteira responsabilidade do usuário. Certifique-se de que a utilização está de acordo
  19. * com as políticas do site e as leis locais. O autor não se responsabiliza por quaisquer danos ou violações decorrentes
  20. * do uso deste script.
  21. *
  22. *
  23. * Legal Disclaimer:
  24. *
  25. * This script is provided "as is," without any warranties, express or implied.
  26. * The use of this script is entirely at the user's own risk. Ensure that its use complies
  27. * with the site's policies and local laws. The author is not responsible for any damages
  28. * or violations resulting from the use of this script.
  29. */
  30.  
  31.  
  32. (function () {
  33. 'use strict';
  34.  
  35. // Helper function to create styled buttons
  36. function createButton(text, onClick) {
  37. const button = document.createElement('button');
  38. button.textContent = text;
  39. button.style.position = 'absolute';
  40. button.style.bottom = '10px';
  41. button.style.right = '10px';
  42. button.style.zIndex = '1000';
  43. button.style.padding = '12px 18px';
  44. button.style.backgroundColor = '#28a745';
  45. button.style.color = '#fff';
  46. button.style.border = 'none';
  47. button.style.borderRadius = '8px';
  48. button.style.fontSize = '16px';
  49. button.style.cursor = 'pointer';
  50. button.style.boxShadow = '0px 5px 10px rgba(0, 0, 0, 0.2)';
  51. button.addEventListener('mouseover', () => {
  52. button.style.backgroundColor = '#218838';
  53. });
  54. button.addEventListener('mouseout', () => {
  55. button.style.backgroundColor = '#28a745';
  56. });
  57. button.onclick = onClick;
  58. return button;
  59. }
  60.  
  61. // Function to add download buttons to videos
  62. function addDownloadButtons() {
  63. const videos = document.querySelectorAll('video');
  64. videos.forEach(video => {
  65. if (!video.parentNode.querySelector('.download-button')) {
  66. const downloadButton = createButton('Download', () => downloadVideo(video));
  67. downloadButton.className = 'download-button';
  68. video.parentNode.style.position = 'relative'; // Ensure parent has relative position for button placement
  69. video.parentNode.appendChild(downloadButton);
  70. }
  71. });
  72. }
  73.  
  74. // Function to download video
  75. function downloadVideo(video) {
  76. let videoUrl = '';
  77.  
  78. // Attempt to get URL from <source> tag
  79. const sourceTag = video.querySelector('source');
  80. if (sourceTag && sourceTag.src) {
  81. videoUrl = sourceTag.src;
  82. }
  83.  
  84. // Fallback: Try direct video attributes
  85. if (!videoUrl) {
  86. videoUrl = video.src || video.getAttribute('data-src') || '';
  87. }
  88.  
  89. // Advanced Fallback: Attempt to fetch video URL via GM_xmlhttpRequest
  90. if (!videoUrl) {
  91. const videoId = video.id;
  92. const config = video.getAttribute('data-setup');
  93. if (config) {
  94. try {
  95. const parsedConfig = JSON.parse(config.replace(/&quot;/g, '"'));
  96. if (parsedConfig.poster) {
  97. videoUrl = parsedConfig.poster.replace(/\.jpg$/, '_720p.mp4');
  98. }
  99. } catch (e) {
  100. console.error('Failed to parse video config:', e);
  101. }
  102. }
  103. }
  104.  
  105. // Log the URL to the console for debugging
  106. console.log('Video URL:', videoUrl);
  107.  
  108. // If URL is found, attempt download
  109. if (videoUrl) {
  110. openVideoInNewTab(videoUrl);
  111. } else {
  112. alert('Could not locate the video URL. Please ensure the video is loaded.');
  113. }
  114. }
  115.  
  116. // Function to open video in a new tab with styling
  117. function openVideoInNewTab(videoUrl) {
  118. const newWindow = window.open('', '_blank');
  119. newWindow.document.write(`
  120. <html>
  121. <head>
  122. <title>Video</title>
  123. <style>
  124. body {
  125. margin: 0;
  126. background-color: black;
  127. display: flex;
  128. justify-content: center;
  129. align-items: center;
  130. height: 100vh;
  131. }
  132. video {
  133. max-width: 90%;
  134. max-height: 90%;
  135. object-fit: contain;
  136. }
  137. </style>
  138. </head>
  139. <body>
  140. <video controls autoplay>
  141. <source src="${videoUrl}" type="video/mp4">
  142. Your browser does not support the video tag.
  143. </video>
  144. </body>
  145. </html>
  146. `);
  147. }
  148.  
  149. // Observe DOM changes to dynamically add buttons
  150. const observer = new MutationObserver(() => addDownloadButtons());
  151. observer.observe(document.body, { childList: true, subtree: true });
  152.  
  153. // Initial call to add buttons
  154. addDownloadButtons();
  155. })();