From 8d5ed41ea70d3ebad8f696615340e973334195d5 Mon Sep 17 00:00:00 2001 From: ImprovedTube Date: Tue, 21 Mar 2023 02:29:50 +0100 Subject: [PATCH] #1538 #551 #1063 #274 #387 toDo: #680 #213 #1170 --- content-scripts/website-context/functions.js | 7 +++++++ content-scripts/website-context/youtube-features/player.js | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/content-scripts/website-context/functions.js b/content-scripts/website-context/functions.js index 7b6b6de81..8c31666d8 100644 --- a/content-scripts/website-context/functions.js +++ b/content-scripts/website-context/functions.js @@ -34,6 +34,13 @@ ImprovedTube.ytElementsHandler = function (node) { if (node.getAttribute('itemprop') === 'genre') { ImprovedTube.genre = node.content; } + if (node.getAttribute('name') === 'keywords') { + ImprovedTube.keywords = node.content; + } + if (node.getAttribute('itemprop') === 'name') { + ImprovedTube.title = node.content; + } + // if (node.getAttribute('name') === 'interactionCount') { ImprovedTube.likes = node.content; } } else if (name === 'YTD-TOGGLE-BUTTON-RENDERER' || name === 'YTD-PLAYLIST-LOOP-BUTTON-RENDERER') { if ( node.parentComponent && diff --git a/content-scripts/website-context/youtube-features/player.js b/content-scripts/website-context/youtube-features/player.js index 9808bf18c..8c6b63164 100644 --- a/content-scripts/website-context/youtube-features/player.js +++ b/content-scripts/website-context/youtube-features/player.js @@ -82,7 +82,11 @@ ImprovedTube.playerPlaybackSpeed = function (change) { if (this.storage.player_forced_playback_speed === true) { if (player.getVideoData().isLive === false && (this.storage.player_force_speed_on_music === true || - (location.href.indexOf('music') === -1 && document.querySelector('h3#title')?.innerText !== 'Music') + (document.querySelector('h3#title')?.innerText !== 'Music' + && (ImprovedTube.genre !== 'Music' || /interview|back[- ]?stage/i.test(ImprovedTube.keywords + ImprovedTube.title) ) + && !/official (music )?video|lyrics|cover[\)\]]|[\(\[]cover|cover version|karaoke|(sing|play)[- ]?along/i.test(ImprovedTube.title + ImprovedTube.keywords) + && location.href.indexOf('music') === -1 + ) )) { player.setPlaybackRate(Number(option)); video.playbackRate = Number(option);