Remove unlisted experiment

This commit is contained in:
Ajay Ramachandran
2021-07-21 11:48:19 -04:00
parent caae61a6a8
commit ff44016003
3 changed files with 4 additions and 71 deletions

View File

@@ -282,9 +282,6 @@ async function videoIDChange(id) {
// Update whitelist data when the video data is loaded
whitelistCheck();
// Temporary expirement
unlistedCheck();
//setup the preview bar
if (previewBar === null) {
if (onMobileYouTube) {
@@ -878,66 +875,6 @@ async function whitelistCheck() {
if (Config.config.forceChannelCheck && sponsorTimes?.length > 0) startSkipScheduleCheckingForStartSponsors();
}
async function unlistedCheck() {
if (!Config.config.allowExpirements || !Config.config.askAboutUnlistedVideos) return;
try {
await utils.wait(() => !!videoInfo && !!document.getElementById("info-text")
&& !!document.querySelector(".ytd-video-primary-info-renderer > .badge > yt-icon > svg"), 6000, 1000);
const isUnlisted = document.querySelector(".ytd-video-primary-info-renderer > .badge > yt-icon > svg > g > path")
?.getAttribute("d")?.includes("M3.9 12c0-1.71 1.39-3.1 3.1-3.1h"); // Icon of unlisted badge
const yearMatches = document.querySelector("#info-text > #info-strings > yt-formatted-string")
?.innerHTML?.match(/20[0-9]{2}/);
const year = yearMatches ? parseInt(yearMatches[0]) : -1;
const isOld = !isNaN(year) && year < 2017 && year > 2004;
const views = parseInt(videoInfo?.videoDetails?.viewCount);
const isHighViews = views > 15000;
if (isUnlisted && isOld && isHighViews && (!sponsorTimes || sponsorTimes.length <= 0)) {
// Ask if they want to submit this videoID
const notice = new GenericNotice(skipNoticeContentContainer, "unlistedWarning", {
title: chrome.i18n.getMessage("experimentUnlistedTitle"),
textBoxes: chrome.i18n.getMessage("experimentUnlistedText").split("\n"),
buttons: [
{
name: chrome.i18n.getMessage("experiementOptOut"),
listener: () => {
Config.config.allowExpirements = false;
notice.close();
}
},
{
name: chrome.i18n.getMessage("hideForever"),
listener: () => {
Config.config.askAboutUnlistedVideos = false;
notice.close();
}
},
{
name: "Submit",
listener: () => {
utils.asyncRequestToServer("POST", "/api/unlistedVideo", {
videoID: sponsorVideoID,
year,
views,
channelID: channelIDInfo.status === ChannelIDStatus.Found ? channelIDInfo.id : undefined
});
notice.close();
}
}
]
});
}
} catch (e) {
return;
}
}
/**
* Returns info about the next upcoming sponsor skip
*/