Sleazy Fork is available in English.

EromeDL

Download videos from EROME with ease, bypassing download restrictions.

Verze ze dne 29. 12. 2024. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name EromeDL
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.7
  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. (function () {
  16. 'use strict';
  17.  
  18. // Helper function to create styled buttons
  19. function createButton(text, onClick) {
  20. const button = document.createElement('button');
  21. button.textContent = text;
  22. button.style.position = 'absolute';
  23. button.style.bottom = '10px';
  24. button.style.right = '10px';
  25. button.style.zIndex = '1000';
  26. button.style.padding = '12px 18px';
  27. button.style.backgroundColor = '#28a745';
  28. button.style.color = '#fff';
  29. button.style.border = 'none';
  30. button.style.borderRadius = '8px';
  31. button.style.fontSize = '16px';
  32. button.style.cursor = 'pointer';
  33. button.style.boxShadow = '0px 5px 10px rgba(0, 0, 0, 0.2)';
  34. button.addEventListener('mouseover', () => {
  35. button.style.backgroundColor = '#218838';
  36. });
  37. button.addEventListener('mouseout', () => {
  38. button.style.backgroundColor = '#28a745';
  39. });
  40. button.onclick = onClick;
  41. return button;
  42. }
  43.  
  44. // Function to add download buttons to videos
  45. function addDownloadButtons() {
  46. const videos = document.querySelectorAll('video');
  47. videos.forEach(video => {
  48. if (!video.parentNode.querySelector('.download-button')) {
  49. const downloadButton = createButton('Download', () => downloadVideo(video));
  50. downloadButton.className = 'download-button';
  51. video.parentNode.style.position = 'relative'; // Ensure parent has relative position for button placement
  52. video.parentNode.appendChild(downloadButton);
  53. }
  54. });
  55. }
  56.  
  57. // Function to download video
  58. function downloadVideo(video) {
  59. let videoUrl = '';
  60.  
  61. // Attempt to get URL from <source> tag
  62. const sourceTag = video.querySelector('source');
  63. if (sourceTag && sourceTag.src) {
  64. videoUrl = sourceTag.src;
  65. }
  66.  
  67. // Fallback: Try direct video attributes
  68. if (!videoUrl) {
  69. videoUrl = video.src || video.getAttribute('data-src') || '';
  70. }
  71.  
  72. // Advanced Fallback: Attempt to fetch video URL via GM_xmlhttpRequest
  73. if (!videoUrl) {
  74. const videoId = video.id;
  75. const config = video.getAttribute('data-setup');
  76. if (config) {
  77. try {
  78. const parsedConfig = JSON.parse(config.replace(/&quot;/g, '"'));
  79. if (parsedConfig.poster) {
  80. videoUrl = parsedConfig.poster.replace(/\.jpg$/, '_720p.mp4');
  81. }
  82. } catch (e) {
  83. console.error('Failed to parse video config:', e);
  84. }
  85. }
  86. }
  87.  
  88. // Log the URL to the console for debugging
  89. console.log('Video URL:', videoUrl);
  90.  
  91. // If URL is found, attempt download
  92. if (videoUrl) {
  93. openVideoInNewTab(videoUrl);
  94. } else {
  95. alert('Could not locate the video URL. Please ensure the video is loaded.');
  96. }
  97. }
  98.  
  99. // Function to open video in a new tab with styling
  100. function openVideoInNewTab(videoUrl) {
  101. const newWindow = window.open('', '_blank');
  102. newWindow.document.write(`
  103. <html>
  104. <head>
  105. <title>Video</title>
  106. <style>
  107. body {
  108. margin: 0;
  109. background-color: black;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. height: 100vh;
  114. }
  115. video {
  116. max-width: 90%;
  117. max-height: 90%;
  118. object-fit: contain;
  119. }
  120. </style>
  121. </head>
  122. <body>
  123. <video controls autoplay>
  124. <source src="${videoUrl}" type="video/mp4">
  125. Your browser does not support the video tag.
  126. </video>
  127. </body>
  128. </html>
  129. `);
  130. }
  131.  
  132. // Observe DOM changes to dynamically add buttons
  133. const observer = new MutationObserver(() => addDownloadButtons());
  134. observer.observe(document.body, { childList: true, subtree: true });
  135.  
  136. // Initial call to add buttons
  137. addDownloadButtons();
  138. })();