浏览代码

Merge branch 'Anarios:main' into main

sy-b 3 年之前
父节点
当前提交
0e1786ecc1

+ 9 - 0
.github/ISSUE_TEMPLATE/bug.yml

@@ -47,3 +47,12 @@ body:
     value: "A bug happened!"
   validations:
     required: true
+- type: textarea
+  attributes:
+    label: How to reproduce/recreate?
+    description: Detailed steps to reproduce/recreate it.
+    placeholder: "We need to be able to reproduce/recreate that bug/event in order to fix it. Please write the steps in detail."
+    value: "Tell us how it happened with detailed steps for us."
+  validations:
+    required: true
+    

+ 2 - 7
Extensions/UserScript/Return Youtube Dislike.user.js

@@ -348,13 +348,8 @@ function setEventListeners(evt) {
     }
   }
 
-  if (
-    window.location.href.indexOf("watch?") >= 0 ||
-    (isMobile && evt?.indexOf("watch?") >= 0)
-  ) {
-    cLog("Setting up...");
-    jsInitChecktimer = setInterval(checkForJS_Finish, 111);
-  }
+  cLog("Setting up...");
+  jsInitChecktimer = setInterval(checkForJS_Finish, 111);
 }
 
 (function () {

+ 1 - 3
Extensions/combined/ryd.content-script.js

@@ -44,9 +44,7 @@ function setEventListeners(evt) {
     }
   }
 
-  if (window.location.href.indexOf("watch?") >= 0) {
-    jsInitChecktimer = setInterval(checkForJS_Finish, 111);
-  }
+  jsInitChecktimer = setInterval(checkForJS_Finish, 111);
 }
 
 setEventListeners();

+ 1 - 1
README.md

@@ -39,7 +39,7 @@ You can learn more at our website at: [returnyoutubedislike.com](https://www.ret
 Third-party use of this open API is allowed with the following restrictions:
 
 
-- **Attribution**: This project should be clearly attributed with either a link to this repo or a link to [returnyoutubedislike.com](https://returnyoutubedislike.com/).
+- **Attribution**: This project should be clearly attributed with a link to [returnyoutubedislike.com](https://returnyoutubedislike.com/).
 - **Rate Limiting**: There are per client rate limits in place of 100 per minute and 10'000 per day. This will return a *429* status code indicating that your application should back off.
 
 The API is accessible over the following base URL:  

+ 1 - 1
Website/nuxt.config.js

@@ -16,7 +16,7 @@ export default {
         hid: "description",
         name: "description",
         content:
-          "An extension that returns dislike statistics to YouTube. For now, it only works if a video had public display of dislikes enabled before YouTube removed dislike stats. ",
+          "An extension that returns dislike statistics to YouTube using a combination of scraped dislike stats and estimates extrapolated from extension user data.",
       },
       { hid: "og:image", name: "og:image", content: "/logo.png" },
       { hid: "theme-color", name: "theme-color", content: "#ff0000" },

+ 6 - 0
Website/pages/faq.vue

@@ -54,6 +54,12 @@ export default {
         answer:
           "Coming soon. We are looking into using Oauth or a different read only API with a limited scope so creators can share their dislike counts verifiability. ",
       },
+      {
+        question:
+          "What data do you collect and how is it treated?",
+        answer:
+          "The extension only collects data that is strictly necessary for it to function properly, such as IP address or ID of the video you're watching. None of your data will ever be sold to 3rd parties. If you would like to know more about how we handle security and privacy check out our [add link here to security-faq.md]",
+      },
     ],
   }),
 };

+ 21 - 0
Website/pages/index.vue

@@ -54,6 +54,11 @@
       </v-btn>
     </div>
 
+    <div class="mb-4" style="color: #999">
+      Get dislikes manually: <input placeholder=" Video URL">
+      <p id="output"></p>
+    </div>
+
     <v-spacer />
 
     <div id="sponsors" class="d-flex flex-column items-center py-8">
@@ -111,6 +116,18 @@ export default {
       ],
     };
   },
+  mounted() {
+    const YOUTUBE_REGEX = /(?:http:|https:)*?\/\/(?:www\.|)(?:youtube\.com|m\.youtube\.com|youtu\.|youtube-nocookie\.com).*(?:v=|v%3D|v\/|(?:a|p)\/(?:a|u)\/\d.*\/|watch\?|vi(?:=|\/)|\/embed\/|oembed\?|be\/|e\/)([^&?%#\/\n]*)/;
+    let lastVideoId = "";
+    window.oninput = (e) => {
+      const videoId = (e.target.value.match(YOUTUBE_REGEX) || {})[1] || e.target.value;
+      if (videoId !== lastVideoId && videoId.length === 11) {
+        fetch("https://returnyoutubedislikeapi.com/votes?videoId=" + (lastVideoId = videoId))
+          .then(resp => resp.json())
+          .then(data => document.getElementById("output").innerText = "Likes=" + data.likes + " Dislikes=" + data.dislikes);
+      }
+    };
+  },
 };
 </script>
 
@@ -120,6 +137,10 @@ export default {
   height: max-content;
 }
 
+input {
+  background-color: #999999;
+}
+
 @media (max-width: 767px) {
   .sponsor {
     margin: 0.5rem;

+ 1 - 1
webpack.config.js

@@ -2,7 +2,7 @@ const path = require("path");
 const CopyPlugin = require("copy-webpack-plugin");
 const FileManagerPlugin = require("filemanager-webpack-plugin");
 
-const entries = ['ryd.content-script', 'ryd.background', 'popup', 'debug'];
+const entries = ['ryd.content-script', 'ryd.background', 'popup'];
 
 const ignorePatterns = [
   "**/manifest-**",