Update tampermonkey script
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
// @noframes
|
// @noframes
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
const API = "https://pocketbase-scratch.site.quack-lab.dev/api/collections/youtubedownload/records";
|
const URL = `https://youtube-download-ws-server.site.quack-lab.dev/download`;
|
||||||
|
|
||||||
function waitForElement(element, selector) {
|
function waitForElement(element, selector) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
@@ -30,13 +30,10 @@ function waitForElement(element, selector) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function parseVideo(videoElement) {
|
function parseVideo(videoElement) {
|
||||||
console.log(videoElement);
|
|
||||||
hookVideo(videoElement);
|
hookVideo(videoElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hookVideo(videoElement) {
|
function hookVideo(videoElement) {
|
||||||
console.log("Hooking", videoElement);
|
|
||||||
|
|
||||||
videoElement.addEventListener(
|
videoElement.addEventListener(
|
||||||
"mousedown",
|
"mousedown",
|
||||||
function (e) {
|
function (e) {
|
||||||
@@ -47,7 +44,7 @@ function hookVideo(videoElement) {
|
|||||||
|
|
||||||
const link = videoElement.querySelector("a#video-title-link").href;
|
const link = videoElement.querySelector("a#video-title-link").href;
|
||||||
console.log(link);
|
console.log(link);
|
||||||
fetch(API, {
|
fetch(URL, {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
Reference in New Issue
Block a user