diff options
author | Ajay Ramachandran <[email protected]> | 2021-06-23 23:46:21 -0400 |
---|---|---|
committer | Ajay Ramachandran <[email protected]> | 2021-06-23 23:46:21 -0400 |
commit | bd2dac69b960cf58dd9ef70c30e89b66eb210597 (patch) | |
tree | 7cecbf9c7f73d8e6e0e7cddcf79aa0b2fc929d79 | |
parent | db72e490dfd46531f72d321fae4262b2b0ed356f (diff) | |
download | SponsorBlock-bd2dac69b960cf58dd9ef70c30e89b66eb210597.tar.gz SponsorBlock-bd2dac69b960cf58dd9ef70c30e89b66eb210597.zip |
Also send views, year and channelID
-rw-r--r-- | src/content.ts | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/content.ts b/src/content.ts index d0a1def1..1bd64b36 100644 --- a/src/content.ts +++ b/src/content.ts @@ -881,14 +881,8 @@ async function unlistedCheck() { ?.innerHTML?.match(/20[0-9]{2}/); const year = yearMatches ? parseInt(yearMatches[0]) : -1; const isOld = !isNaN(year) && year < 2017 && year > 2004; - const isHighViews = parseInt(videoInfo?.videoDetails?.viewCount) > 20000; - - console.log({ - isUnlisted, - year, - isOld, - isHighViews - }) + const views = parseInt(videoInfo?.videoDetails?.viewCount); + const isHighViews = views > 20000; if (isUnlisted && isOld && isHighViews) { // Ask if they want to submit this videoID @@ -916,7 +910,10 @@ async function unlistedCheck() { name: "Submit", listener: () => { utils.asyncRequestToServer("POST", "/api/unlistedVideo", { - videoID: sponsorVideoID + videoID: sponsorVideoID, + year, + views, + channelID: channelIDInfo.status === ChannelIDStatus.Found ? channelIDInfo.id : undefined }); notice.close(); |