Media Link Extractor

Extract all media links from sites like Cyberdrop.me and bunkr.site, display them in a UI for easy copying, and show a link counter. More to come!

当前为 2025-01-08 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Media Link Extractor
  3. // @namespace http://tampermonkey.net/
  4. // @version 3.0
  5. // @description Extract all media links from sites like Cyberdrop.me and bunkr.site, display them in a UI for easy copying, and show a link counter. More to come!
  6. // @author 1axx
  7. // @match https://cyberdrop.me/*
  8. // @match https://files.fm/*
  9. // @match https://app.koofr.net/*
  10. // @match https://bunkr.site/*
  11. // @grant GM_setClipboard
  12. // @license MIT
  13. // @icon https://img.freepik.com/premium-photo/link-icon-3d-render-illustration_567294-4275.jpg?semt=ais_hybrid
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. 'use strict';
  18.  
  19. let mediaLinks = [];
  20.  
  21. // Function to collect media links for Cyberdrop
  22. function collectCyberdropLinks() {
  23. const mediaElements = document.querySelectorAll('.image-container.column a.image');
  24. mediaElements.forEach((el) => {
  25. const href = el.getAttribute('href');
  26. if (href) {
  27. mediaLinks.push(href.startsWith('http') ? href : `https://cyberdrop.me${href}`);
  28. }
  29. });
  30. }
  31.  
  32. // Function to collect media links for Files.fm
  33. function collectFilesFmLinks() {
  34. const linkElements = document.querySelectorAll('.item.file.image-item a.top_button_download.my_tooltip, .item.file.video-item a.top_button_download.my_tooltip');
  35. linkElements.forEach((item) => {
  36. const href = item.getAttribute('href');
  37. if (href) {
  38. mediaLinks.push(href.startsWith('http') ? href : `https://files.fm${href}`);
  39. }
  40. });
  41. }
  42.  
  43. // Function to collect media links for app.koofr.net (modified for the /content/links/ pattern)
  44. function collectKoofrLinks() {
  45. const linkElements = document.querySelectorAll('a[href^="/content/links/"]');
  46. linkElements.forEach((el) => {
  47. const href = el.getAttribute('href');
  48. if (href) {
  49. mediaLinks.push(`https://app.koofr.net${href}`);
  50. }
  51. });
  52. }
  53.  
  54. // Function to collect media links for bunkr.site
  55. function collectBunkrSiteLinks() {
  56. const linkElements = document.querySelectorAll('a[href^="https://bunkrrr.org/"]');
  57. linkElements.forEach((el) => {
  58. const href = el.getAttribute('href');
  59. if (href) {
  60. mediaLinks.push(href);
  61. }
  62. });
  63. }
  64.  
  65. // Function to collect media links for mega.nz
  66. function collectMegaNzLinks() {
  67. const linkElements = document.querySelectorAll('img[src^="blob:https://mega.nz/"]');
  68. linkElements.forEach((el) => {
  69. const src = el.getAttribute('src');
  70. if (src) {
  71. mediaLinks.push(`https://mega.nz${src}`);
  72. }
  73. });
  74. }
  75.  
  76. // Function to detect the site and collect media links accordingly
  77. function collectMediaLinks() {
  78. mediaLinks = []; // Clear previous links
  79. if (window.location.host.includes('cyberdrop.me')) {
  80. collectCyberdropLinks();
  81. } else if (window.location.host.includes('files.fm')) {
  82. collectFilesFmLinks();
  83. } else if (window.location.host.includes('app.koofr.net')) {
  84. collectKoofrLinks();
  85. } else if (window.location.host.includes('mega.nz')) {
  86. collectMegaNzLinks();
  87. } else if (window.location.host.includes('bunkr.site')){
  88. collectBunkrSiteLinks();
  89. }
  90. }
  91.  
  92. // Function to display the collected links in a UI
  93. function displayLinksUI() {
  94. const popup = document.createElement('div');
  95. popup.style.cssText = `
  96. position: fixed;
  97. top: 20%;
  98. left: 50%;
  99. transform: translate(-50%, -20%);
  100. background-color: #121212;
  101. padding: 20px;
  102. border: 2px solid #444;
  103. border-radius: 10px;
  104. z-index: 10000;
  105. width: 60%;
  106. box-shadow: 0px 0px 20px rgba(0, 255, 255, 0.3);
  107. `;
  108.  
  109. const textarea = document.createElement('textarea');
  110. textarea.value = mediaLinks.join('\n');
  111. textarea.style.cssText = `
  112. width: 100%;
  113. height: 200px;
  114. margin-bottom: 10px;
  115. background-color: #181818;
  116. color: #00FFFF;
  117. border: 1px solid #555;
  118. border-radius: 5px;
  119. padding: 10px;
  120. font-family: Consolas, "Courier New", monospace;
  121. font-size: 14px;
  122. resize: none;
  123. `;
  124. popup.appendChild(textarea);
  125.  
  126. const counter = document.createElement('div');
  127. counter.textContent = `Total Links: ${mediaLinks.length}`;
  128. counter.style.cssText = `
  129. margin-bottom: 10px;
  130. font-weight: bold;
  131. text-align: center;
  132. color: #00FFFF;
  133. `;
  134. popup.appendChild(counter);
  135.  
  136. const copyButton = document.createElement('button');
  137. copyButton.textContent = 'Copy to Clipboard';
  138. copyButton.style.cssText = `
  139. padding: 10px;
  140. background-color: #007bff;
  141. color: white;
  142. border: none;
  143. border-radius: 5px;
  144. cursor: pointer;
  145. `;
  146. copyButton.addEventListener('click', () => {
  147. textarea.select();
  148. document.execCommand('copy');
  149. alert('Links copied to clipboard!');
  150. });
  151. popup.appendChild(copyButton);
  152.  
  153. const closeButton = document.createElement('button');
  154. closeButton.textContent = 'Close';
  155. closeButton.style.cssText = `
  156. margin-left: 10px;
  157. padding: 10px;
  158. background-color: #dc3545;
  159. color: white;
  160. border: none;
  161. border-radius: 5px;
  162. cursor: pointer;
  163. `;
  164. closeButton.addEventListener('click', () => {
  165. document.body.removeChild(popup);
  166. });
  167. popup.appendChild(closeButton);
  168.  
  169. document.body.appendChild(popup);
  170. }
  171.  
  172. // Add a button to trigger the process
  173. const extractButton = document.createElement('button');
  174. extractButton.textContent = 'Extract Media Links';
  175. extractButton.style.cssText = `
  176. position: fixed;
  177. top: 10px;
  178. right: 10px;
  179. z-index: 9999;
  180. background-color: #007bff;
  181. color: white;
  182. border: none;
  183. padding: 10px 15px;
  184. border-radius: 5px;
  185. cursor: pointer;
  186. box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  187. `;
  188. extractButton.addEventListener('click', () => {
  189. collectMediaLinks();
  190. if (mediaLinks.length > 0) {
  191. displayLinksUI();
  192. } else {
  193. alert('No media links found!');
  194. }
  195. });
  196.  
  197. document.body.appendChild(extractButton);
  198. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址