Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Mar 21, 2023
1 parent eeacc57 commit 2c54b3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions content-scripts/website-context/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
6 changes: 5 additions & 1 deletion content-scripts/website-context/youtube-features/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2c54b3d

Please sign in to comment.