YouTube油管视频下载🤩&去广告多合一|HD/2K/4K|视频&音频&获取封面 🔥📥

YouTube视频下载神器,支持1080P/2K高清视频下载,封面下载,支持视频/音频分离下载,合并下载

  1. // ==UserScript==
  2. // @name YouTube Video Downloader 🤩& Ad Blocker| HD/2K/4K Quality | Video&Audio&Cover🔥📥
  3. // @name:zh-CN YouTube油管视频下载🤩&去广告多合一|HD/2K/4K|视频&音频&获取封面 🔥📥
  4. // @name:en YouTube Video Downloader🤩 & Ad Blocker| HD/2K/4K Quality | Video&Audio&Cover 🔥📥
  5. // @name:ja YouTube動画ダウンローダー🤩&広告ブロッカー|HD/2K/4K高画質|ビデオ&オーディオ&カバー 🔥📥
  6. // @name:es Descargador de YouTube y Bloqueador🤩 de Anuncios | Calidad HD/2K/4K | Video y Audio&Portada🔥📥
  7. // @name:pt Baixador do YouTube e Bloqueador 🤩de Anúncios | Qualidade HD/2K/4K | Vídeo e Áudio&Capa 🔥📥
  8. // @namespace http://tampermonkey.net/
  9. // @version 0.3
  10. // @description:zh-cn YouTube视频下载神器,支持1080P/2K高清视频下载,封面下载,支持视频/音频分离下载,合并下载
  11. // @description Download YouTube videos in HD(1080P/2K), subtitles support, video/audio separate download, shorts download, completely free & no ads
  12. // @description:en Download YouTube videos in HD(1080P/2K), subtitles support, video/audio separate download, shorts download, completely free & no ads
  13. // @description:ja YouTubeビデオをHD(1080P/2K)でダウンロード、字幕対応、ビデオ/オーディオ分離ダウンロード、ショート動画対応、完全無料&広告なし
  14. // @description:es Descarga videos de YouTube en HD(1080P/2K), soporte de subtítulos, descarga separada de video/audio, descarga de shorts, completamente gratis y sin anuncios
  15. // @description:pt Baixe vídeos do YouTube em HD(1080P/2K), suporte a legendas, download separado de vídeo/áudio, download de shorts, totalmente gratuito e sem anúncios
  16. // @author YouhouLab
  17. // @license MIT
  18. // @match *://*.youtube.com/*
  19. // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
  20. // @grant GM_addStyle
  21. // @grant GM_xmlhttpRequest
  22. // @grant GM_getValue
  23. // @grant GM_setValue
  24. // @connect www.saveanyyoutube.com
  25. // @run-at document-start
  26. // @supportURL https://saveanyyoutube.com
  27. // @require https://cdn.jsdelivr.net/npm/sweetalert2@11
  28. // @compatible chrome
  29. // @compatible firefox
  30. // @compatible opera
  31. // @compatible edge
  32. // @compatible safari
  33. // @keywords youtube, download, video, audio, subtitle, shorts, hd, 1080p, 2k, 4k, free, no ads, ad blocker, ad free, remove ads, block ads, addyoutube, 油管, 视频下载, 字幕下载, 高清视频, 免费下载, 无广告, 去广告, 广告拦截, YouTube下载器, 短视频下载, ユーチューブ, ダウンロード, 動画保存, 字幕, 高画質, 無料, 広告ブロック, 広告なし, 유튜브, 다운로드, 동영상, 자막, 고화질, 무료, 광고 차단
  34. // ==/UserScript==
  35. (function () {
  36. "use strict";
  37. GM_addStyle("#player-ads{display:none !important}");
  38. GM_addStyle("ytd-ad-slot-renderer{display:none !important}");
  39. GM_addStyle(
  40. "ytd-rich-item-renderer:has(ytd-ad-slot-renderer){display:none !important}"
  41. );
  42. let observer = null;
  43. const hasQueryParamV = () => {
  44. return /[\?&]v=/.test(location.href);
  45. };
  46. const skipAd = () => {
  47. let video = document.querySelector(`.ad-showing video`);
  48. let skipButton = document.querySelector(`.ytp-ad-skip-button`);
  49. if (skipButton) {
  50. skipButton.click();
  51. }
  52. if (video) {
  53. video.currentTime = video.duration;
  54. }
  55. return;
  56. };
  57. const startObserve = () => {
  58. const target = document.querySelector(`.video-ads.ytp-ad-module`);
  59. if (!target) {
  60. observer = null;
  61. return;
  62. }
  63. observer = new MutationObserver(skipAd);
  64. observer.observe(target, {
  65. childList: true,
  66. subtree: true,
  67. });
  68. return observer;
  69. };
  70. setInterval(() => {
  71. if (hasQueryParamV()) {
  72. if (!observer) {
  73. startObserve();
  74. }
  75. } else {
  76. if (observer) {
  77. observer.disconnect();
  78. observer = null;
  79. }
  80. }
  81. }, 200);
  82. })();
  83.  
  84.  
  85. (function() {
  86. 'use strict';
  87. const i18n = {
  88. 'zh': {
  89. downloadText: 'Free Download',
  90. error: {
  91. addNormalButton: '添加普通下载按钮时出错:',
  92. addShortsButton: '添加Shorts下载按钮时出错:'
  93. }
  94. },
  95. 'en': {
  96. downloadText: 'Free Download',
  97. error: {
  98. addNormalButton: 'Error adding normal download button:',
  99. addShortsButton: 'Error adding Shorts download button:'
  100. }
  101. },
  102. 'ja': {
  103. downloadText: '無料ダウンロード',
  104. error: {
  105. addNormalButton: '通常ダウンロードボタンの追加エラー:',
  106. addShortsButton: 'Shortsダウンロードボタンの追加エラー:'
  107. }
  108. },
  109. 'es': {
  110. downloadText: 'Descarga Gratis',
  111. error: {
  112. addNormalButton: 'Error al agregar botón de descarga normal:',
  113. addShortsButton: 'Error al agregar botón de descarga Shorts:'
  114. }
  115. },
  116. 'pt': {
  117. downloadText: 'Download Grátis',
  118. error: {
  119. addNormalButton: 'Erro ao adicionar botão de download normal:',
  120. addShortsButton: 'Erro ao adicionar botão de download Shorts:'
  121. }
  122. }
  123. };
  124. GM_addStyle(`
  125. .youhou-download-btn {
  126. background: rgb(242, 242, 242);
  127. border: none;
  128. border-radius: 18px;
  129. color: #0f0f0f;
  130. padding: 0 16px;
  131. height: 36px;
  132. cursor: pointer;
  133. font-size: 14px;
  134. font-weight: 500;
  135. white-space: nowrap;
  136. }
  137. .youhou-download-btn:hover {
  138. background: rgb(230, 230, 230);
  139. }
  140. .youhou-buttons-wrapper {
  141. display: flex;
  142. align-items: center;
  143. gap: 8px;
  144. }
  145. `);
  146. function waitForElement(selector, callback, maxTries = 10) {
  147. let tries = 0;
  148. function check() {
  149. const element = document.querySelector(selector);
  150. if (element) {
  151. callback(element);
  152. return;
  153. }
  154. tries++;
  155. if (tries < maxTries) {
  156. setTimeout(check, 1000);
  157. }
  158. }
  159. check();
  160. }
  161. function createDownloadButton() {
  162. if (document.querySelector('.youhou-download-btn')) {
  163. return;
  164. }
  165. const downloadButton = document.createElement('button');
  166. downloadButton.className = 'youhou-download-btn';
  167. downloadButton.textContent = i18n['zh'].downloadText;
  168. downloadButton.addEventListener('click', function() {
  169. const videoUrl = window.location.href;
  170. const newUrl = videoUrl.replace('youtube.com', 'saveanyyoutube.com');
  171. window.open(newUrl, '_blank');
  172. });
  173. return downloadButton;
  174. }
  175. function tryAddButton() {
  176. waitForElement('#subscribe-button button', (subscribeButton) => {
  177. if (!document.querySelector('.youhou-download-btn')) {
  178. const downloadButton = createDownloadButton();
  179. const container = subscribeButton.closest('#subscribe-button');
  180. if (container) {
  181. const wrapper = document.createElement('div');
  182. wrapper.className = 'youhou-buttons-wrapper';
  183. container.parentNode.insertBefore(wrapper, container);
  184. wrapper.appendChild(container);
  185. wrapper.appendChild(downloadButton);
  186. }
  187. }
  188. });
  189. }
  190. document.addEventListener('yt-navigate-finish', function() {
  191. if (window.location.pathname.includes('/watch')) {
  192. setTimeout(tryAddButton, 1000);
  193. }
  194. });
  195. if (window.location.pathname.includes('/watch')) {
  196. setTimeout(tryAddButton, 1000);
  197. }
  198. })();

QingJ © 2025

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