YouTube 小助手

YouTube 1.视频循环播放 2.截图下载 3.主题进度条

  1. // ==UserScript==
  2. // @name YouTube Helper
  3. // @name:ar مساعد يوتيوب
  4. // @name:bg YouTube асистент
  5. // @name:cs Asistent YouTube
  6. // @name:da YouTube -assistent
  7. // @name:de YouTube -Assistent
  8. // @name:el Βοηθός του YouTube
  9. // @name:en YouTube Assistant
  10. // @name:eo YouTube -Asistanto
  11. // @name:es Asistente de YouTube
  12. // @name:fi YouTube -avustaja
  13. // @name:fr Assistant YouTube
  14. // @name:fr-CA Assistant YouTube
  15. // @name:he עוזר YouTube
  16. // @name:hr YouTube pomoćnik
  17. // @name:hu YouTube asszisztens
  18. // @name:id Asisten YouTube
  19. // @name:it Assistente YouTube
  20. // @name:ja YouTubeアシスタント
  21. // @name:ka YouTube ასისტენტი
  22. // @name:ko YouTube Assistant
  23. // @name:nb YouTube -assistent
  24. // @name:nl YouTube -assistent
  25. // @name:pl Asystent YouTube
  26. // @name:pt-BR Assistente do YouTube
  27. // @name:ro Asistent YouTube
  28. // @name:ru YouTube Assistant
  29. // @name:sk Asistent YouTube
  30. // @name:sr ИоуТубе асистент
  31. // @name:sv YouTube Assistant
  32. // @name:th ผู้ช่วย YouTube
  33. // @name:tr YouTube Assistant
  34. // @name:ug YouTube ياردەمچىسى
  35. // @name:uk Асистент YouTube
  36. // @name:vi Trợ lý YouTube
  37. // @name:zh YouTube 小助手
  38. // @name:zh-CN YouTube 小助手
  39. // @name:zh-HK YouTube 小助手
  40. // @name:zh-SG YouTube 小助手
  41. // @name:zh-TW YouTube 小助手
  42. // @description YouTube 1.Loop playback of YouTube videos 2.screenshot download 3.themed progress bar.
  43. // @description:ar YouTube 1. تشغيل حلقة الفيديو 2. تنزيل لقطة الشاشة 3.
  44. // @description:bg YouTube 1. Възпроизвеждане на видео контур 2. Изтегляне на екранна снимка 3. Бар за напредък на темата
  45. // @description:cs YouTube 1.. Přehrávání video smyčky 2.
  46. // @description:da YouTube 1. Video Loop Playback 2.. Skærmbillede Download 3. Tema -statuslinje
  47. // @description:de YouTube 1. Video Loop -Wiedergabe 2. Screenshot Download 3. Thema Fortschrittsleiste
  48. // @description:el YouTube 1. Αναπαραγωγή βρόχου βίντεο 2. ΠΕΡΙΕΧΟΜΕΝΟ ΣΤΟΙΧΕΙΑ 3.
  49. // @description:en YouTube 1. Video loop playback 2. Screenshot download 3. Theme progress bar
  50. // @description:eo YouTube 1. Video Loop Playback 2.
  51. // @description:es YouTube 1. Video Loop Playback 2. Descarga de captura de pantalla 3. Barra de progreso del tema
  52. // @description:fi YouTube 1.
  53. // @description:fr YouTube 1. Playback de boucle vidéo 2. Capture d’écran Télécharger 3. Bar de progression du thème
  54. // @description:fr-CA YouTube 1. Playback de boucle vidéo 2. Capture d’écran Télécharger 3. Bar de progression du thème
  55. // @description:he YouTube 1. השמעת לולאת וידאו 2. הורדת צילום מסך 3. סרגל התקדמות נושא
  56. // @description:hr YouTube 1. Video petlja reprodukcija 2. Snimka zaslona Preuzmite 3.
  57. // @description:hu YouTube 1. Video hurok lejátszása 2. képernyőkép letöltése 3. Téma előrehaladási sáv
  58. // @description:id YouTube 1. Video Loop Playback 2. Screenshot Unduh 3. Tema Kemajuan Bilah
  59. // @description:it YouTube 1. Riproduzione del loop video 2. Screenshot Download 3. Barra di avanzamento del tema
  60. // @description:ja YouTube1。ビデオループ再生2。スクリーンショットダウンロード3。テーマの進行状況バー
  61. // @description:ka YouTube 1. ვიდეო მარყუჟის დაკვრა 2. სკრინშოტის ჩამოტვირთვა 3. თემის პროგრესის ბარი
  62. // @description:ko YouTube 1. 비디오 루프 재생 2. 스크린 샷 다운로드 3. 테마 진행률 바
  63. // @description:nb YouTube 1. Video Loop Playback 2. Skjermbilde nedlasting 3. Tema Progress Bar
  64. // @description:nl YouTube 1. Video Loop Playback 2. Screenshot Download 3. Theme voortgangsbalk
  65. // @description:pl YouTube 1. Pętla wideo odtwarzanie 2. Pobierz zrzut ekranu 3.
  66. // @description:pt-BR YouTube 1. Playback de loop de vídeo.
  67. // @description:ro YouTube 1. Redarea buclelor video 2. Descărcare de ecran 3. Tema Progress Bar
  68. // @description:ru YouTube 1. Playback Video Playback 2. Скачать экрана 3.
  69. // @description:sk YouTube 1. Prehrávanie video slučky 2. Screenshot Stiahnutie 3.
  70. // @description:sr ИоуТубе 1. Репродукција видео петље 2. Сцреенсхот Довнлоад 3. Тхеме Топресс Бар
  71. // @description:sv YouTube 1. Video Loop Playback 2. Skärmdump nedladdning 3. Theme Progress Bar
  72. // @description:th YouTube 1. การเล่นวิดีโอลูป 2. การดาวน์โหลดภาพหน้าจอ 3. ธีมความคืบหน้าแถบ
  73. // @description:tr YouTube 1. Video Döngüsü Oynatma 2. Ekran Görüntüsü İndir 3. Tema İlerleme Çubuğu
  74. // @description:ug YouTube 1. سىن ئايلانما قويۇش 2. ئېكران رەسىمى 3 نى چۈشۈرۈڭ. باشتېمىنى ئىلگىرى سۈرۈش بالدىقى
  75. // @description:uk YouTube 1. Відеокласник відеокліту
  76. // @description:vi YouTube 1. Video Loop Playback 2. Ảnh chụp màn hình tải xuống 3. Thanh tiến trình chủ đề
  77. // @description:zh YouTube 1.视频循环播放 2.截图下载 3.主题进度条
  78. // @description:zh-CN YouTube 1.视频循环播放 2.截图下载 3.主题进度条
  79. // @description:zh-HK YouTube 1.視頻循環播放 2.截圖下載 3.主題進度條
  80. // @description:zh-SG YouTube 1.视频循环播放 2.截图下载 3.主题进度条
  81. // @description:zh-TW YouTube 1.視頻循環播放 2.截圖下載 3.主題進度條
  82. // @author Carokahn,bernzrdo,FunnyMonkey,人民的勤务员 <china.qinwuyuan@gmail.com>
  83. // @namespace https://github.com/ChinaGodMan/UserScripts
  84. // @supportURL https://github.com/ChinaGodMan/UserScripts/issues
  85. // @homepageURL https://github.com/ChinaGodMan/UserScripts
  86. // @license MIT
  87. // @icon https://www.youtube.com/s/desktop/ee47b5e0/img/logos/favicon_144x144.png
  88. // @match https://www.youtube.com/*
  89. // @match https://m.youtube.com/*
  90. // @compatible chrome
  91. // @compatible firefox
  92. // @compatible edge
  93. // @compatible opera
  94. // @compatible safari
  95. // @compatible kiwi
  96. // @compatible qq
  97. // @compatible via
  98. // @compatible brave
  99. // @version 2025.03.15.0436
  100. // @grant GM_addStyle
  101. // @created 2025-03-14 20:36:01
  102. // @modified 2025-03-14 20:36:01
  103. // ==/UserScript==
  104. /**
  105. * File: youtube-helper.user.js
  106. * Project: UserScripts
  107. * File Created: 2025/03/15,Saturday 04:36:02
  108. * Author: 人民的勤务员@ChinaGodMan (china.qinwuyuan@gmail.com)
  109. * -----
  110. * Last Modified: 2025/03/15,Saturday 05:57:23
  111. * Modified By: 人民的勤务员@ChinaGodMan (china.qinwuyuan@gmail.com)
  112. * -----
  113. * License: MIT License
  114. * Copyright © 2024 - 2025 ChinaGodMan,Inc
  115. */
  116. const directDownload = true
  117. const infiniteLool = true
  118.  
  119.  
  120.  
  121.  
  122.  
  123. const loopVideo = () => {
  124. const video = document.querySelector('video')
  125. if (video && !video.loop) {
  126. video.loop = true
  127. }
  128. }
  129. const ThemeProgressbar = () => {
  130. const css_248z = '.html5-play-progress,.ytp-play-progress{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAMCAIAAAAs6UAAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUNCQzIyREQ0QjdEMTFFMzlEMDM4Qzc3MEY0NzdGMDgiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUNCQzIyREU0QjdEMTFFMzlEMDM4Qzc3MEY0NzdGMDgiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQ0JDMjJEQjRCN0QxMUUzOUQwMzhDNzcwRjQ3N0YwOCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQ0JDMjJEQzRCN0QxMUUzOUQwMzhDNzcwRjQ3N0YwOCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PovDFgYAAAAmSURBVHjaYvjPwMAAxjMZmBhA9H8INv4P4TPM/A+m04zBNECAAQBCWQv9SUQpVgAAAABJRU5ErkJggg==") repeat-x!important;background:linear-gradient(180deg,red 0,red 16.5%,#f90 0,#f90 33%,#ff0 0,#ff0 50%,#3f0 0,#3f0 66%,#09f 0,#09f 83.5%,#63f 0,#63f)!important;background:-webkit-linear-gradient(top,red,red 16.5%,#f90 0,#f90 33%,#ff0 0,#ff0 50%,#3f0 0,#3f0 66%,#09f 0,#09f 83.5%,#63f 0,#63f)!important;background:-moz-linear-gradient(top,red 0,red 16.5%,#f90 16.5%,#f90 33%,#ff0 33%,#ff0 50%,#3f0 50%,#3f0 66%,#09f 66%,#09f 83.5%,#63f 83.5%,#63f 100%)!important}.html5-load-progress,.ytp-load-progress{background:url("data:image/gif;base64,R0lGODlhMAAMAIAAAAxBd////yH/C05FVFNDQVBFMi4wAwEAAAAh+QQECgAAACwAAAAAMAAMAAACJYSPqcvtD6MKstpLr24Z9A2GYvJ544mhXQmxoesElIyCcB3dRgEAIfkEBAoAAAAsAQACAC0ACgAAAiGEj6nLHG0enNQdWbPefOHYhSLydVhJoSYXPO04qrAmJwUAIfkEBAoAAAAsBQABACkACwAAAiGEj6nLwQ8jcC5ViW3evHt1GaE0flxpphn6BNTEqvI8dQUAIfkEBAoAAAAsAQABACoACwAAAiGEj6nLwQ+jcU5VidPNvPtvad0GfmSJeicUUECbxnK0RgUAIfkEBAoAAAAsAAAAACcADAAAAiCEj6mbwQ+ji5QGd6t+c/v2hZzYiVpXmuoKIikLm6hXAAAh+QQECgAAACwAAAAALQAMAAACI4SPqQvBD6NysloTXL480g4uX0iW1Wg21oem7ismLUy/LFwAACH5BAQKAAAALAkAAAAkAAwAAAIghI8Joe0Po0yBWTaz3g/z7UXhMX7kYmplmo0rC8cyUgAAIfkEBAoAAAAsBQAAACUACgAAAh2Ejwmh7Q+jbIFZNrPeEXPudU74IVa5kSiYqOtRAAAh+QQECgAAACwEAAAAIgAKAAACHISPELfpD6OcqTGKs4bWRp+B36YFi0mGaVmtWQEAIfkEBAoAAAAsAAAAACMACgAAAh2EjxC36Q+jnK8xirOW1kavgd+2BYtJhmnpiGtUAAAh+QQECgAAACwAAAAALgALAAACIYSPqcvtD+MKicqLn82c7e6BIhZQ5jem6oVKbfdqQLzKBQAh+QQECgAAACwCAAIALAAJAAACHQx+hsvtD2OStDplKc68r2CEm0eW5uSN6aqe1lgAADs=")!important}.html5-scrubber-button,.ytp-scrubber-button{background:url("data:image/gif;base64,R0lGODlhIgAVAKIHAL3/9/+Zmf8zmf/MmZmZm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nVlZefQ1tZgQBAXJIi1eHUTRwi0lhl48QL0sogxaGDhMlUo2gh14fHhcVmnOrrxNqrU9joX21Q0IUElm7DQkAOw==")!important;border:none!important;height:21px!important;margin-left:-18px!important;margin-top:0!important;transform:scale(.8);-webkit-transform:scale(.8);-moz-transform:scale(.8);-ms-transform:scale(.8);width:34px!important}.ytp-progress-bar-container:hover .ytp-load-progress,.ytp-progress-bar-container:hover .ytp-scrubber-button{image-rendering:pixelated}.html5-progress-bar-container,.ytp-progress-bar-container{height:12px!important}.html5-progress-bar,.ytp-progress-bar{margin-top:12px!important}.html5-progress-list,.video-ads .html5-progress-list.html5-ad-progress-list,.video-ads .ytp-progress-list.ytp-ad-progress-list,.ytp-progress-list{height:12px!important}.ytp-volume-slider-track{background:#0c4177!important}'
  131. GM_addStyle(css_248z)
  132. }
  133.  
  134. let escapeHTMLPolicy = 'trustedTypes' in window
  135. ? trustedTypes.createPolicy('forceInner', { createHTML: html => html })
  136. : { createHTML: html => html }
  137. function screenBtnUpdate() {
  138. let $miniplayerBtn = document.querySelector('button.ytp-miniplayer-button')
  139. if ($miniplayerBtn && !document.getElementById('ytp-screenshot-button')) {
  140. const $btn = document.createElement('button')
  141. $btn.id = 'ytp-screenshot-button'
  142. $btn.classList.add('ytp-screenshot-button', 'ytp-button')
  143. $btn.dataset.priority = '5'
  144. $btn.dataset.tooltipTargetId = 'ytp-screenshot-button'
  145. $btn.dataset.titleNoTooltip = 'Screenshot'
  146. $btn.ariaLabel = 'Screenshot'
  147. $btn.title = 'Screenshot'
  148. $btn.innerHTML = escapeHTMLPolicy.createHTML(`<svg height="100%" version="1.1" viewBox="-300 -1260 1560 1560" width="100%">
  149. <use class="ytp-svg-shadow" xlink:href="#ytp-id-screenshot-svg"></use>
  150. <path
  151. d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"
  152. fill="#fff" id="ytp-id-screenshot-svg"></path>
  153. </svg>`)
  154. $btn.addEventListener('click', screenshot)
  155.  
  156. insertBefore($btn, $miniplayerBtn)
  157. }
  158.  
  159. requestAnimationFrame(screenBtnUpdate)
  160. }
  161. function insertBefore($element, $sibling) {
  162. $sibling.parentElement.insertBefore($element, $sibling)
  163. }
  164. function screenshot() {
  165.  
  166. const $video = document.querySelector('#player video')
  167. if (!$video) {
  168. console.error('No video found to screenshot!')
  169. return
  170. }
  171.  
  172. let wasPlaying = !$video.paused
  173. if (wasPlaying) $video.pause()
  174.  
  175. const $canvas = document.createElement('canvas')
  176. $canvas.width = $video.videoWidth
  177. $canvas.height = $video.videoHeight
  178.  
  179. let oldCss = $video.style.cssText
  180. $video.style.width = $video.videoWidth + 'px'
  181. $video.style.height = $video.videoHeight + 'px'
  182.  
  183. const ctx = $canvas.getContext('2d')
  184. ctx.drawImage($video, 0, 0, $video.videoWidth, $video.videoHeight)
  185.  
  186. $canvas.toBlob(blob => {
  187.  
  188. if (directDownload) {
  189. const a = document.createElement('a')
  190. a.href = URL.createObjectURL(blob)
  191. a.download = `${getFileName()}.png`
  192. a.click()
  193. } else {
  194. const item = new ClipboardItem({ 'image/png': blob })
  195. navigator.clipboard.write([item])
  196. }
  197.  
  198. $video.style.cssText = oldCss
  199. $canvas.remove()
  200. if (wasPlaying) $video.play()
  201.  
  202. })
  203.  
  204. }
  205. function getFileName() {
  206. const safeFileName = document.title.replace(/[\\/:*?"<>|]/g, '').replace(' - YouTube', '')
  207. return safeFileName
  208. }
  209. if (infiniteLool) {
  210. const observer = new MutationObserver(loopVideo)
  211. observer.observe(document.body, { childList: true, subtree: true })
  212. }
  213.  
  214. requestAnimationFrame(screenBtnUpdate)
  215. ThemeProgressbar()

QingJ © 2025

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