Place your cookie file named cookies.google.txt in /cache/import before enabling.
- {{ app_form.downloads_cookie_import }}
+ {{ app_form.downloads_cookie_import }}
+ {% if config.downloads.cookie_import %}
+
+
+
+ {% endif %}
diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js
index 69caac74..e20d31c0 100644
--- a/tubearchivist/static/script.js
+++ b/tubearchivist/static/script.js
@@ -699,6 +699,24 @@ function postSponsorSegmentVote(videoId, uuid, vote) {
apiRequest(apiEndpoint, "POST", data);
}
+function handleCookieValidate() {
+ document.getElementById("cookieButton").remove();
+ var cookieMessageElement = document.getElementById("cookieMessage");
+ cookieMessageElement.innerHTML = `Processing.`;
+ response = postCookieValidate();
+ if (response.cookie_validated == true) {
+ cookieMessageElement.innerHTML = `The cookie file is valid.`;
+ } else {
+ cookieMessageElement.innerHTML = `Warning, the cookie file is invalid.`;
+ }
+}
+
+// Check youtube cookie settings
+function postCookieValidate() {
+ var apiEndpoint = "/api/cookie/";
+ return apiRequest(apiEndpoint, "POST");
+}
+
// Makes api requests when passed an endpoint and method ("GET", "POST", "DELETE")
function apiRequest(apiEndpoint, method, data) {
const xhttp = new XMLHttpRequest();