mirror of
https://github.com/Anarios/return-youtube-dislike.git
synced 2026-11-12 17:11:30 +01:00
Remove unused function
This commit is contained in:
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user