Remove unused function

This commit is contained in:
tech234a authored and GitHub committed 2021-12-14 22:16:28 -05:00
1 parent edb19da747
commit 08640d2bb8
1 file changed
-31
@@ -329,37 +329,6 @@ function numberFormat(numberState) {
return formatter.format(roundDown(numberState)).replace(/\.0|,0/, "");
}
function getDislikesFromYoutubeResponse(htmlResponse) {
let start =
htmlResponse.indexOf('"videoDetails":') + '"videoDetails":'.length;
let end =
htmlResponse.indexOf('"isLiveContent":false}', start) +
'"isLiveContent":false}'.length;
if (end < start) {
end =
htmlResponse.indexOf('"isLiveContent":true}', start) +
'"isLiveContent":true}'.length;
}
let jsonStr = htmlResponse.substring(start, end);
let jsonResult = JSON.parse(jsonStr);
let rating = jsonResult.averageRating;
start = htmlResponse.indexOf('"topLevelButtons":[', end);
start =
htmlResponse.indexOf('"accessibilityData":', start) +
'"accessibilityData":'.length;
end = htmlResponse.indexOf("}", start);
let likes = +htmlResponse.substring(start, end).replace(/\D/g, "");
let dislikes = (likes * (5 - rating)) / (rating - 1);
let result = {
likes,
dislikes: Math.round(dislikes),
rating,
viewCount: +jsonResult.viewCount,
};
return result;
}
function setEventListeners(evt) {
let jsInitChecktimer;