Media Link Extractor

Extract media links from various websites.

  1. // ==UserScript==
  2. // @name Media Link Extractor
  3. // @namespace http://tampermonkey.net/
  4. // @version 3.3
  5. // @description Extract media links from various websites.
  6. // @author 1axx
  7. // @icon https://img.freepik.com/premium-photo/link-icon-3d-render-illustration_567294-4275.jpg
  8. // @include https://cyberdrop.me/*
  9. // @include https://files.fm/*
  10. // @include https://app.koofr.net/*
  11. // @include https://bunkr.*/*
  12. // @include https://*.dropbox.com/*
  13. // @include https://www.redd.tube/*
  14. // @include https://shiroko.co/*
  15. // @grant GM_setClipboard
  16. // @license MIT
  17. // ==/UserScript==
  18.  
  19. (function () {
  20. 'use strict';
  21.  
  22. const uiSettings = {
  23. 'cyberdrop.me': {
  24. button: { top: '8px', right: '440px', bg: '#008b96', width: '40px', height: '40px' },
  25. panel: { bg: '#222', textColor: '#8F2AA3' }
  26. },
  27. 'files.fm': {
  28. button: { top: '90px', right: '30px', bg: '#181A1B' },
  29. panel: { bg: '#333', textColor: '#E8E6E3' }
  30. },
  31. 'app.koofr.net': {
  32. button: { top: '15px', right: '110px', bg: '#263238' },
  33. panel: { bg: '#121212', textColor: '#71BA05' }
  34. },
  35. 'bunkr': {
  36. button: { top: '13px', right: '290px', bg: '#1E2936' },
  37. panel: { bg: '#181818', textColor: '#7B39EB' }
  38. },
  39. 'dropbox.com': {
  40. button: { top: '15px', right: '290px', bg: '#3E3D3C' },
  41. panel: { bg: '#232323', textColor: '#3984FF' }
  42. },
  43. 'redd.tube': {
  44. button: { top: '5px', right: '390px', bg: '#185DCC' },
  45. panel: { bg: '#1a1a1a', textColor: '#EDCC32' }
  46. },
  47. 'shiroko.co': {
  48. button: { top: '5px', right: '1540px', bg: '#FFFFFF' },
  49. panel: { bg: '#1a1a1a', textColor: '#FFFFFF' }
  50. },
  51. 'default': {
  52. button: { top: '10px', right: '10px', bg: '#10161F' },
  53. panel: { bg: '#000', textColor: '#10161F' }
  54. }
  55. };
  56.  
  57. // Supported site configurations
  58. const siteConfigs = {
  59. 'cyberdrop.me': { selector: '.image-container.column a.image' },
  60.  
  61. 'files.fm': { selector: '.item.file.image-item a.top_button_download, .item.file.video-item a.top_button_download' },
  62.  
  63. 'app.koofr.net': { selector: 'a[href^="/content/links/"], a[href^="/links/"]' },
  64.  
  65. 'bunkr': { selector: 'a[href^="https://bunkrrr.org/"], a[href^="/f/"]' },
  66.  
  67. 'dropbox.com': { selector: 'a[href^="https://www.dropbox.com/scl/"]' },
  68.  
  69. 'redd.tube': { selector: 'a[href^="/video/"]' },
  70.  
  71. 'shiroko.co': { selector: 'a[href^="https://ggredi.info/"]',}
  72. };
  73.  
  74. let mediaLinks = new Set(); // Store unique links
  75.  
  76. function getSiteSettings() {
  77. const host = Object.keys(uiSettings).find(key => window.location.host.includes(key)) || 'default';
  78. return uiSettings[host];
  79. }
  80.  
  81. function collectMediaLinks() {
  82. const host = Object.keys(siteConfigs).find(key => window.location.host.includes(key));
  83. if (!host) return;
  84.  
  85. mediaLinks.clear();
  86. const elements = document.querySelectorAll(siteConfigs[host].selector);
  87. elements.forEach(el => {
  88. const link = el.getAttribute('href');
  89. if (link) {
  90. mediaLinks.add(link.startsWith('http') ? link : `${window.location.origin}${link}`);
  91. }
  92. });
  93. }
  94.  
  95. function createUI() {
  96. const settings = getSiteSettings();
  97.  
  98. // Create Extract Button
  99. const extractButton = document.createElement('button');
  100. extractButton.textContent = '☰';
  101. extractButton.style.position = 'fixed';
  102. extractButton.style.width = settings.button.width;
  103. extractButton.style.height = settings.button.height;
  104. extractButton.style.top = settings.button.top;
  105. extractButton.style.right = settings.button.right;
  106. extractButton.style.backgroundColor = settings.button.bg;
  107. extractButton.style.color = '#fff';
  108. extractButton.style.border = 'none';
  109. extractButton.style.padding = '10px 15px';
  110. extractButton.style.borderRadius = '5px';
  111. extractButton.style.cursor = 'pointer';
  112. extractButton.style.zIndex = '10001';
  113.  
  114. extractButton.addEventListener('click', () => {
  115. collectMediaLinks();
  116. displayLinksUI();
  117. });
  118.  
  119. document.body.appendChild(extractButton);
  120. }
  121.  
  122. function displayLinksUI() {
  123. if (mediaLinks.size === 0) return;
  124.  
  125. const settings = getSiteSettings();
  126.  
  127. // Create Popup Container
  128. const popup = document.createElement('div');
  129. popup.style.position = 'fixed';
  130. popup.style.top = '20%';
  131. popup.style.left = '50%';
  132. popup.style.transform = 'translate(-50%, -20%)';
  133. popup.style.backgroundColor = settings.panel.bg;
  134. popup.style.padding = '20px';
  135. popup.style.border = '2px solid ' + settings.panel.textColor;
  136. popup.style.borderRadius = '10px';
  137. popup.style.zIndex = '10000';
  138. popup.style.width = '60%';
  139. popup.style.boxShadow = `0px 0px 20px rgba(0, 255, 255, 0.3)`;
  140.  
  141. // Textarea for Links
  142. const textarea = document.createElement('textarea');
  143. textarea.value = Array.from(mediaLinks).join('\n');
  144. textarea.style.width = '100%';
  145. textarea.style.height = '200px';
  146. textarea.style.marginBottom = '10px';
  147. textarea.style.backgroundColor = '#181818';
  148. textarea.style.color = settings.panel.textColor;
  149. textarea.style.border = '1px solid #555';
  150. textarea.style.borderRadius = '5px';
  151. textarea.style.padding = '10px';
  152. textarea.style.fontFamily = 'Consolas, "Courier New", monospace';
  153. textarea.style.fontSize = '14px';
  154. textarea.style.resize = 'none';
  155. popup.appendChild(textarea);
  156.  
  157. // Counter
  158. const counter = document.createElement('div');
  159. counter.textContent = `Total Unique Links: ${mediaLinks.size}`;
  160. counter.style.marginBottom = '10px';
  161. counter.style.fontWeight = 'bold';
  162. counter.style.textAlign = 'center';
  163. counter.style.color = settings.panel.textColor;
  164. popup.appendChild(counter);
  165.  
  166. // Copy Button
  167. const copyButton = document.createElement('button');
  168. copyButton.textContent = 'Copy to Clipboard';
  169. copyButton.style.padding = '10px';
  170. copyButton.style.backgroundColor = settings.panel.textColor;
  171. copyButton.style.color = '#fff';
  172. copyButton.style.border = 'none';
  173. copyButton.style.borderRadius = '5px';
  174. copyButton.style.cursor = 'pointer';
  175. copyButton.addEventListener('click', () => {
  176. textarea.select();
  177. document.execCommand('copy');
  178. alert('Links copied to clipboard!');
  179. });
  180. popup.appendChild(copyButton);
  181.  
  182. // Close Button
  183. const closeButton = document.createElement('button');
  184. closeButton.textContent = 'Close';
  185. closeButton.style.marginLeft = '10px';
  186. closeButton.style.padding = '10px';
  187. closeButton.style.backgroundColor = '#dc3545';
  188. closeButton.style.color = 'white';
  189. closeButton.style.border = 'none';
  190. closeButton.style.borderRadius = '5px';
  191. closeButton.style.cursor = 'pointer';
  192. closeButton.addEventListener('click', () => document.body.removeChild(popup));
  193. popup.appendChild(closeButton);
  194.  
  195. document.body.appendChild(popup);
  196. }
  197.  
  198. createUI();
  199. })();