|
70 | 70 | // @description:en Youtube Tools All in one local Download mp4, MP3 HIGT QUALITY
|
71 | 71 | // @description Youtube Tools All in one local Download mp4, MP3 HIGT QUALITY
|
72 | 72 | // @homepage https://github.com/DeveloperMDCM/
|
73 |
| -// @version 2.2.92 |
| 73 | +// @version 2.3.0 |
74 | 74 | // @author MDCM
|
75 | 75 | // @match https://*.youtube.com/*
|
76 | 76 | // @exclude *://music.youtube.com/*
|
|
240 | 240 | // justify-content: center;
|
241 | 241 | // align-items: center;
|
242 | 242 | // }
|
| 243 | + |
243 | 244 | #yt-enhancement-panel {
|
244 | 245 | position: fixed;
|
245 | 246 | top: 60px;
|
|
276 | 277 | #toggle-panel {
|
277 | 278 | position: fixed;
|
278 | 279 | top: 10px;
|
279 |
| - right: 180px; |
| 280 | + right: 115px; |
280 | 281 | z-index: 10000;
|
281 | 282 | color: white;
|
282 | 283 | padding: 5px;
|
|
446 | 447 | align-items: center;
|
447 | 448 | flex-wrap: wrap;
|
448 | 449 | gap: 10px;
|
| 450 | + } |
| 451 | + .containerButtons > button:hover { |
| 452 | + cursor: pointer; |
| 453 | + } |
| 454 | + #container.ytd-masthead { |
| 455 | + height: 56px; |
| 456 | + padding: 0 16px; |
| 457 | + display: flexbox; |
| 458 | + display: flex; |
| 459 | + flex-direction: row; |
| 460 | + align-items: center; |
| 461 | + justify-content: start; |
| 462 | + } |
| 463 | + body { |
| 464 | + padding: 0; |
| 465 | + margin: 0; |
| 466 | + overflow-y: scroll; |
| 467 | + overflow-x: hidden; |
| 468 | + } |
| 469 | + .style-scope.ytd-comments { |
| 470 | + overflow-y: auto; |
| 471 | + overflow-x: hidden; |
| 472 | + height: auto; |
| 473 | + max-height: 100vh; |
| 474 | + } |
| 475 | + ytd-item-section-renderer.ytd-watch-next-secondary-results-renderer { |
| 476 | + --ytd-item-section-item-margin: 8px; |
| 477 | + overflow-y: auto; |
| 478 | + overflow-x: hidden; |
| 479 | + height: auto; |
| 480 | + max-height: 130vh; |
| 481 | + } |
| 482 | + .right-section.ytcp-header { |
| 483 | + display: flex; |
| 484 | + flex: 1; |
| 485 | + align-items: center; |
| 486 | + gap: 15px; |
| 487 | + justify-content: end; |
449 | 488 | }
|
450 | 489 | #meta.ytd-playlist-panel-video-renderer {
|
451 | 490 | min-width: 0;
|
|
553 | 592 | </svg>
|
554 | 593 | </button>
|
555 | 594 | `;
|
556 |
| - |
557 |
| - const modeReverse = ` |
558 |
| - <button title="Reverse" class="botones_div" type="button" id="invertir"> |
559 |
| - <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-arrows-diff" width="24" |
560 |
| - height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" |
561 |
| - stroke-linecap="round" stroke-linejoin="round"> |
562 |
| - <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> |
563 |
| - <path d="M11 16h10"></path> |
564 |
| - <path d="M11 16l4 4"></path> |
565 |
| - <path d="M11 16l4 -4"></path> |
566 |
| - <path d="M13 8h-10"></path> |
567 |
| - <path d="M13 8l-4 4"></path> |
568 |
| - <path d="M13 8l-4 -4"></path> |
569 |
| - </svg> |
570 |
| -</button> |
571 |
| - `; |
| 595 | + |
572 | 596 |
|
573 | 597 | const filterEyes = `
|
574 | 598 |
|
|
700 | 724 | </button>
|
701 | 725 | `;
|
702 | 726 |
|
| 727 | + const bufferVideo = ` |
| 728 | + <button title="Buffer video" type="button" class="buffer_video botones_div"> |
| 729 | + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-align-box-right-stretch"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 17h2" /><path d="M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" /><path d="M11 12h6" /><path d="M13 7h4" /></svg> |
| 730 | +</button> |
| 731 | + `; |
| 732 | + |
703 | 733 |
|
704 | 734 | const menuBotones = `
|
705 | 735 | <main>
|
706 | 736 | <div class="container">
|
707 | 737 | <form>
|
708 | 738 | <div class="containerButtons">
|
709 | 739 | ${thumbnailVideo}
|
710 |
| - ${modeReverse} |
| 740 | + ${bufferVideo} |
711 | 741 | ${filterEyes}
|
712 | 742 | ${resetButton}
|
713 | 743 | ${repeatVideo}
|
|
984 | 1014 | <input type="checkbox" id="translation-toggle"> Translate comments / Reload page
|
985 | 1015 | </label>
|
986 | 1016 | </div>
|
| 1017 | + <div class="enhancement-option"> |
| 1018 | + <label> |
| 1019 | + <input type="checkbox" id="reverse-mode-toggle"> Reverse mode |
| 1020 | + </label> |
| 1021 | + </div> |
987 | 1022 |
|
988 | 1023 | <div class="enhancement-option">
|
989 | 1024 | <label>Video Player Size: <span id="player-size-value">100</span>%</label> <button class="tab-button-active" id="reset-player-size">Reset video size</button>
|
|
1151 | 1186 | <input type="checkbox" id="translation-toggle"> Translate comments / Reload page
|
1152 | 1187 | </label>
|
1153 | 1188 | </div>
|
| 1189 | + <div class="enhancement-option"> |
| 1190 | + <label> |
| 1191 | + <input type="checkbox" id="reverse-mode-toggle"> Reverse mode |
| 1192 | + </label> |
| 1193 | + </div> |
1154 | 1194 |
|
1155 | 1195 | <div class="enhancement-option">
|
1156 | 1196 | <label>Video Player Size: <span id="player-size-value">100</span>%</label> <button class="tab-button-active" id="reset-player-size">Reset video size</button>
|
|
1336 | 1376 | dislikes: $id('dislikes-toggle').checked,
|
1337 | 1377 | themes: $id('themes-toggle').checked,
|
1338 | 1378 | translation: $id('translation-toggle').checked,
|
| 1379 | + reverseMode: $id('reverse-mode-toggle').checked, |
1339 | 1380 | hideComments: $id('hide-comments-toggle').checked,
|
1340 | 1381 | hideSidebar: $id('hide-sidebar-toggle').checked,
|
1341 | 1382 | disableAutoplay: $id('autoplay-toggle').checked,
|
|
1373 | 1414 | $id('dislikes-toggle').checked = settings.dislikes || true;
|
1374 | 1415 | $id('themes-toggle').checked = settings.themes || false;
|
1375 | 1416 | $id('translation-toggle').checked = settings.translation || false;
|
| 1417 | + $id('reverse-mode-toggle').checked = settings.reverseMode || false; |
1376 | 1418 | $id('hide-comments-toggle').checked = settings.hideComments || false;
|
1377 | 1419 | $id('hide-sidebar-toggle').checked = settings.hideSidebar || false;
|
1378 | 1420 | $id('autoplay-toggle').checked = settings.disableAutoplay || false;
|
|
1430 | 1472 | dislikes: $id('dislikes-toggle').checked,
|
1431 | 1473 | themes: $id('themes-toggle').checked,
|
1432 | 1474 | translation: $id('translation-toggle').checked,
|
| 1475 | + reverseMode: $id('reverse-mode-toggle').checked, |
1433 | 1476 | hideComments: $id('hide-comments-toggle').checked,
|
1434 | 1477 | hideSidebar: $id('hide-sidebar-toggle').checked,
|
1435 | 1478 | disableAutoplay: $id('autoplay-toggle').checked,
|
|
1596 | 1639 | $sp('--yt-spec-static-brand-white', selectedTheme.textColor);
|
1597 | 1640 | $sp('--ytd-searchbox-background', selectedTheme.gradient);
|
1598 | 1641 | $sp('--ytd-searchbox-text-color', selectedTheme.textColor);
|
1599 |
| - |
| 1642 | + $sp('--ytcp-text-primary', settings.textColor); |
1600 | 1643 | GM_addStyle(`
|
1601 | 1644 |
|
1602 | 1645 | .botones_div {
|
|
1662 | 1705 | $sp('--yt-spec-static-brand-white', settings.timeColorPicker);
|
1663 | 1706 | $sp('--ytd-searchbox-background', settings.primaryColorPicker);
|
1664 | 1707 | $sp('--ytd-searchbox-text-color', settings.secondaryColorPicker);
|
1665 |
| - |
| 1708 | + $sp('--ytcp-text-primary', settings.primaryColorPicker); |
1666 | 1709 | GM_addStyle(`
|
1667 |
| - |
| 1710 | + .html5-video-player { |
| 1711 | + color: ${settings.primaryColorPicker} !important; |
| 1712 | + } |
| 1713 | + .ytp-volume-slider-handle:before, .ytp-volume-slider-handle, .ytp-tooltip.ytp-preview:not(.ytp-text-detail) { |
| 1714 | + background-color: ${settings.iconsColorPicker} !important; |
| 1715 | + } |
| 1716 | + .ytp-autonav-toggle-button[aria-checked=true] { |
| 1717 | + background-color: ${settings.iconsColorPicker} !important; |
| 1718 | + } |
| 1719 | + .tp-yt-iron-icon { |
| 1720 | + fill: ${settings.iconsColorPicker} !important; |
| 1721 | + } |
| 1722 | +
|
| 1723 | + #columns.style-scope.ytd-watch-flexy { |
| 1724 | + flex-direction: ${settings.reverseMode ? 'row-reverse' : 'row'} !important; |
| 1725 | + } |
1668 | 1726 | .botones_div {
|
1669 | 1727 | background-color: transparent;
|
1670 | 1728 | border: none;
|
|
1941 | 1999 |
|
1942 | 2000 | const btnImagen = $e('#imagen');
|
1943 | 2001 | const formularioButtons = $e('#eyes');
|
1944 |
| - const invertirVista = $e('#invertir'); |
1945 |
| - |
1946 |
| - const reverse = $e('#columns'); |
1947 |
| - |
1948 |
| - let countViewRow = 0; // Count |
1949 |
| - if (invertirVista != undefined) { |
1950 |
| - invertirVista.onclick = () => { |
1951 |
| - countViewRow += 1; |
1952 |
| - switch (countViewRow) { |
1953 |
| - case 1: |
1954 |
| - reverse.style.flexDirection = 'row-reverse'; |
1955 |
| - break; |
1956 |
| - case 2: |
1957 |
| - reverse.style.flexDirection = 'row'; |
1958 |
| - countViewRow = 0; |
1959 |
| - break; |
1960 |
| - } |
1961 |
| - }; |
| 2002 | + |
| 2003 | + function initClickEvent() { |
| 2004 | + const bufferVideo = $e('.buffer_video'); |
| 2005 | + |
| 2006 | + if (!bufferVideo) { |
| 2007 | + console.log("Botón no encontrado, esperando..."); |
| 2008 | + return; |
| 2009 | + } |
| 2010 | + |
| 2011 | + // Evita duplicar el evento |
| 2012 | + if (!bufferVideo.dataset.listenerAdded) { |
| 2013 | + bufferVideo.addEventListener("click", () => { |
| 2014 | + const video = document.querySelector("video"); |
| 2015 | + |
| 2016 | + if (!video) { |
| 2017 | + console.log("No se encontró el video en la página."); |
| 2018 | + return; |
| 2019 | + } |
| 2020 | + |
| 2021 | + // Simular clic derecho |
| 2022 | + const event = new MouseEvent("contextmenu", { |
| 2023 | + bubbles: true, |
| 2024 | + cancelable: true |
| 2025 | + }); |
| 2026 | + |
| 2027 | + video.dispatchEvent(event); |
| 2028 | + |
| 2029 | + setTimeout(() => { |
| 2030 | + const option = document.querySelector("body > div.ytp-popup.ytp-contextmenu > div > div > div:nth-child(7)"); |
| 2031 | + if (option) { |
| 2032 | + option.click(); |
| 2033 | + } else { |
| 2034 | + console.log("Opción no encontrada, intenta aumentar el tiempo de espera."); |
| 2035 | + } |
| 2036 | + }, 1000); |
| 2037 | + }); |
| 2038 | + |
| 2039 | + bufferVideo.dataset.listenerAdded = "true"; |
| 2040 | + console.log("Evento registrado con éxito."); |
| 2041 | + } |
1962 | 2042 | }
|
| 2043 | + |
| 2044 | + setInterval(initClickEvent, 2000); |
| 2045 | + |
| 2046 | + |
1963 | 2047 |
|
1964 | 2048 | // valido modo oscuro y venta de video
|
1965 | 2049 | // Repeat video button
|
|
2237 | 2321 |
|
2238 | 2322 | console.log(
|
2239 | 2323 | '%cYoutube Tools Extension NEW UI\n' +
|
2240 |
| - '%cRun %c(v2.2.92)\n' + |
| 2324 | + '%cRun %c(v2.3.0)\n' + |
2241 | 2325 | 'By: DeveloperMDCM.',
|
2242 | 2326 | HEADER_STYLE,
|
2243 | 2327 | CODE_STYLE,
|
|
0 commit comments