Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube committed Nov 7, 2023
1 parent 2ddc797 commit 2212f51
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
16 changes: 15 additions & 1 deletion js&css/extension/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,18 @@ extension.storage.load = function (callback) {
callback(extension.storage.data);
}
});
};
};

/*--------------------------------------------------------------
# Experimental remedy for many uninstalls since October 18, for no apparent reason (unrelated to us)
from @dodieboy's UO rules https://github.com/code-charity/youtube/issues/1809#issuecomment-1783983060
--------------------------------------------------------------*/

window.addEventListener('load', function () {
if (window.location.hostname === 'www.youtube.com') {
yt.config_.openPopupConfig.supportedPopups.adBlockMessageViewModel = false;
Object.prototype.adBlocksFound = 0;
ytplayer.config.args.raw_player_response.adPlacements = [];
Object.prototype.hasAllowedInstreamAd = true;
}
});
5 changes: 2 additions & 3 deletions js&css/web-accessible/www.youtube.com/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,8 @@ ImprovedTube.playerPlaybackSpeed = function () {
var musicIdentifiersTagsOnly = /, (lyrics|remix|song|music|AMV|theme song|full song),/i;
var musicIdentifiersTags = new RegExp(musicIdentifiersTagsOnly.source + musicIdentifiers.source, "i");
var keywordsAmount = 1 + ((keywords || '').match(/,/) || []).length;
if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08 {
musicRegexMatch = true)
}
if ( ((keywords || '').match(musicIdentifiersTags) || []).length / keywordsAmount > 0.08) {
musicRegexMatch = true}
}
let notMusicRegexMatch = /\bdo[ck]u|interv[iyj]|back[- ]?stage||entrevista||||wawancara|مقابلة|интервью|entretien| ||||وثائقي|документальный/i.test(title + " " + keywords);
// (Tags/keywords shouldnt lie & very few songs titles might have these words)
Expand Down

0 comments on commit 2212f51

Please sign in to comment.