防止YouTube频道页面特色视频自动播放

防止YouTube频道简介页面上的特色视频自动播放。

  1. // ==UserScript==
  2. // @name Prevent autoplayed featured videos on YouTube channel profile pages
  3. // @description Prevent autoplayed featured videos on YouTube channel profile pages.
  4. // @name:ar منع تشغيل فيديوهات مميزة تلقائيًا بصفحات قنوات يوتيوب
  5. // @description:ar منع تشغيل الفيديوهات المميزة تلقائيًا في صفحات ملفات قنوات يوتيوب.
  6. // @name:bg Предотвратяване на авт. видеа в YouTube профили
  7. // @description:bg Предотвратяване на автоматично възпроизвеждане на представени видеа на профилните страници на канали в YouTube.
  8. // @name:cs Zabránit aut. přehrávání videí na YouTube profilech
  9. // @description:cs Zabránit automatickému přehrávání doporučených videí na stránkách profilů kanálů YouTube.
  10. // @name:da Forhindr aut. afspilning på YouTube kanalprofiler
  11. // @description:da Forhindr automatisk afspilning af fremhævede videoer på YouTube-kanalprofil sider.
  12. // @name:de Verhindern von Autoplay auf YouTube-Profilseiten
  13. // @description:de Verhindern des automatischen Abspielens von vorgestellten Videos auf YouTube-Kanalprofilseiten.
  14. // @name:el Αποτροπή aut. βίντεο σε YouTube προφίλ καναλιών
  15. // @description:el Αποτροπή αυτόματης αναπαραγωγής προβεβλημένων βίντεο στις σελίδες προφίλ καναλιών YouTube.
  16. // @name:en Prevent autoplayed featured videos on YouTube profiles
  17. // @description:en Prevent autoplayed featured videos on YouTube channel profile pages.
  18. // @name:eo Malhelpi aut. ludon en YouTube kanalprofiloj
  19. // @description:eo Malhelpi aŭtomatan ludon de elstaraj filmetoj en YouTube-kanalaj profilpaĝoj.
  20. // @name:es Evitar aut. videos en perfiles de canales YouTube
  21. // @description:es Evitar la reproducción automática de videos destacados en las páginas de perfil de canales de YouTube.
  22. // @name:fi Estä aut. videoiden toisto YouTube-profiileissa
  23. // @description:fi Estä esiteltyjen videoiden automaattinen toisto YouTube-kanavien profiilisivuilla.
  24. // @name:fr Empêcher aut. vidéos sur profils YouTube
  25. // @description:fr Empêcher la lecture automatique des vidéos mises en avant sur les pages de profil des chaînes YouTube.
  26. // @name:fr-CA Empêcher aut. vidéos sur profils YouTube
  27. // @description:fr-CA Empêcher la lecture automatique des vidéos en vedette sur les pages de profil des chaînes YouTube.
  28. // @name:he מניעת השמעת סרטונים אוטו' בפרופילי YouTube
  29. // @description:he מניעת השמעה אוטומטית של סרטונים מומלצים בדפי פרופיל ערוצי YouTube.
  30. // @name:hr Sprječavanje aut. videa na YouTube profilima
  31. // @description:hr Sprječavanje automatskog reproduciranja istaknutih videa na stranicama profila YouTube kanala.
  32. // @name:hu Megakadályozza aut. videók YouTube profilokon
  33. // @description:hu Megakadályozza a kiemelt videók automatikus lejátszását a YouTube-csatorna profiloldalain.
  34. // @name:id Cegah aut. video unggulan di profil YouTube
  35. // @description:id Cegah pemutaran otomatis video unggulan di halaman profil kanal YouTube.
  36. // @name:it Impedisci aut. video su profili YouTube
  37. // @description:it Impedisci la riproduzione automatica dei video in evidenza sulle pagine dei profili dei canali YouTube.
  38. // @name:ja YouTubeチャンネルで注目の動画自動再生を防ぐ
  39. // @description:ja YouTubeチャンネルプロフィールページでの注目の動画の自動再生を防ぐ。
  40. // @name:ka YouTube-ზე ავტო დაკვრის თავიდან აცილება
  41. // @description:ka YouTube-ის არხის პროფილის გვერდებზე გამორჩეული ვიდეოების ავტომატური დაკვრის თავიდან აცილება.
  42. // @name:ko YouTube 채널 프로필에서 자동 재생 방지
  43. // @description:ko YouTube 채널 프로필 페이지에서 추천 동영상의 자동 재생 방지.
  44. // @name:nb Forhindre aut. videoer på YouTube profiler
  45. // @description:nb Forhindre automatisk avspilling av fremhevede videoer på YouTube-kanalprofil sider.
  46. // @name:nl Voorkom aut. video’s op YouTube profielen
  47. // @description:nl Voorkom automatisch afspelen van aanbevolen video’s op YouTube-kanaalprofielpagina’s.
  48. // @name:pl Zapobiegaj aut. filmom na profilach YouTube
  49. // @description:pl Zapobiegaj automatycznemu odtwarzaniu polecanych filmów na stronach profili kanałów YouTube.
  50. // @name:pt-BR Impedir aut. vídeos em perfis do YouTube
  51. // @description:pt-BR Impedir a reprodução automática de vídeos em destaque nas páginas de perfil de canais do YouTube.
  52. // @name:ro Împiedică aut. video pe profiluri YouTube
  53. // @description:ro Împiedică redarea automată a videoclipurilor recomandate pe paginile de profil ale canalelor YouTube.
  54. // @name:ru Предотвращение авт. видео на профилях YouTube
  55. // @description:ru Предотвращение автоматического воспроизведения избранных видео на страницах профилей каналов YouTube.
  56. // @name:sk Zabrániť aut. videám na profiloch YouTube
  57. // @description:sk Zabrániť automatickému prehrávaniu odporúčaných videí na stránkach profilov kanálov YouTube.
  58. // @name:sr Спречи аутоматску репродукцију на YouTube профилима
  59. // @description:sr Спречавање аутоматске репродукције истакнутих видео записа на страницама профила YouTube канала.
  60. // @name:sv Förhindra aut. videor på YouTube profiler
  61. // @description:sv Förhindra automatisk uppspelning av utvalda videor på YouTube-kanalprofil sidor.
  62. // @name:th ป้องกันวิดีโอเด่น aut. ในโปรไฟล์ YouTube
  63. // @description:th ป้องกันการเล่นอัตโนมัติของวิดีโอเด่นในหน้าประวัติช่อง YouTube
  64. // @name:tr YouTube profilinde aut. videoları engelle
  65. // @description:tr YouTube kanal profil sayfalarında öne çıkan videoların otomatik oynatılmasını engelle.
  66. // @name:ug YouTube پروفىلدىكى فىلىملارنىڭ aut. توسۇش
  67. // @description:ug YouTube قانال پروفىل بەتلىرىدىكى تەۋسىيە قىلىنغان فىلىملارنىڭ ئاپتوماتىك ئوينىلىشىنى توسۇش.
  68. // @name:uk Запобігання авт. відео на профілях YouTube
  69. // @description:uk Запобігання автоматичному відтворенню рекомендованих відео на сторінках профілів каналів YouTube.
  70. // @name:vi Ngăn aut. video trên hồ sơ kênh YouTube
  71. // @description:vi Ngăn chặn phát tự động các video nổi bật trên trang hồ sơ kênh YouTube.
  72. // @name:zh 防止YouTube频道页面特色视频自动播放
  73. // @description:zh 防止YouTube频道简介页面上的特色视频自动播放。
  74. // @name:zh-CN 防止YouTube频道页面特色视频自动播放
  75. // @description:zh-CN 防止YouTube频道简介页面上的特色视频自动播放。
  76. // @name:zh-HK 防止YouTube頻道頁面特色影片自動播放
  77. // @description:zh-HK 防止YouTube頻道簡介頁面上的特色影片自動播放。
  78. // @name:zh-SG 防止YouTube频道页面特色视频自动播放
  79. // @description:zh-SG 防止YouTube频道简介页面上的特色视频自动播放。
  80. // @name:zh-TW 防止YouTube頻道頁面精選影片自動播放
  81. // @description:zh-TW 防止YouTube頻道簡介頁面上的精選影片自動播放。
  82. // @namespace http://tampermonkey.net/
  83. // @version 1.3.1.2
  84. // @author aspen138
  85. // @match https://www.youtube.com/@*/featured
  86. // @match https://www.youtube.com/@*
  87. // @match https://www.youtube.com/*
  88. // @exclude https://www.youtube.com/watch?v=*
  89. // @grant none
  90. // @license MIT
  91. // ==/UserScript==
  92. (function() {
  93. 'use strict';
  94. // Function to pause the video
  95. function pauseVideo() {
  96. const video = document.querySelector('video');
  97. if (video && !video.paused) {
  98. video.pause();
  99. //console.log('YouTube autoplay video paused.');
  100. }
  101. }
  102. // Function to bold and highlight the specified element and its children
  103. function highlightElement() {
  104. const element = document.querySelector('.page-header-view-model-wiz__page-header-content-metadata');
  105. if (element) {
  106. element.style.backgroundColor = 'yellow'; // Highlight with yellow background
  107. // Bold and mimic the style for each child
  108. Array.from(element.children).forEach(child => {
  109. child.style.fontWeight = 'bold'; // Make each child bold
  110. child.style.color = 'red'; // Set font color to red
  111. child.style.textDecoration = 'none'; // Remove any text decoration if needed
  112. });
  113. // Also, bold and mimic styles for any spans inside the children
  114. const spans = element.querySelectorAll('span');
  115. spans.forEach(span => {
  116. span.style.fontWeight = 'bold';
  117. span.style.color = 'red'; // Set font color to red
  118. span.style.textDecoration = 'none'; // Remove any text decoration
  119. });
  120. //console.log('Element and its children highlighted and bolded with red font color.');
  121. }
  122. }
  123. // Create a MutationObserver to monitor for video elements
  124. const observer = new MutationObserver((mutations) => {
  125. pauseVideo();
  126. highlightElement();
  127. });
  128. // Start observing the document body for changes
  129. observer.observe(document.body, { childList: true, subtree: true });
  130. // Attempt to pause the video and highlight the element immediately in case they're already there
  131. pauseVideo();
  132. highlightElement();
  133. // Counter for setInterval executions
  134. let executionCount = 0;
  135. // Use setInterval to repeatedly check for the element and apply styles
  136. const intervalId = setInterval(() => {
  137. highlightElement();
  138. executionCount++;
  139. // Clear the interval after two executions
  140. if (executionCount >= 2) {
  141. clearInterval(intervalId);
  142. }
  143. }, 1000); // Check every 1000 milliseconds (1 second)
  144. })();

QingJ © 2025

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