diff --git a/html/poketube.ejs b/html/poketube.ejs
index 20a013a8..1f999806 100644
--- a/html/poketube.ejs
+++ b/html/poketube.ejs
@@ -1601,8 +1601,35 @@ Recommended Videos
<% if (!f) { %>
-<% k.Video.Recommendations?.Video?.forEach(x => { %>
<% }) %><% } %>
-
+<% inv_vid?.recommendedVideos.forEach(x => { %>
+
+ <% }) %>
+ <% } %>
+
<% if (f) { %>
<% tj.forEach(x => { %>
@@ -1703,7 +1730,7 @@ Recommended Videos
}
- <% if (k.Video.Recommendations.Video) { %>
+ <% if (inv_vid?.recommendedVideos) { %>
let checkbox = document.getElementById("continue");
@@ -1711,10 +1738,10 @@ checkbox.addEventListener('change', function(e) {
if (checkbox.checked) {
console.log("[AUTOPLAY] enabled");
document.getElementById('video').addEventListener('ended', autoplaynextvideo, false);
- let url = window.location.hostname + "/watch?v=<%- k?.Video?.Recommendations?.Video[0]?.id%>";
+ let url = window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId %>";
function autoplaynextvideo(e) {
- location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>";
+ location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>";
}
}
if (/[?&]autoplay=/.test(location.search)) {
@@ -1725,7 +1752,7 @@ checkbox.addEventListener('change', function(e) {
if (/[?&]autoplay=/.test(location.search)) {
if (checkbox.checked) {
- fetch("https://" + window.location.hostname + "/watch?v=<%- k.Video.Recommendations?.Video[0].id%>").then(() => {})
+ fetch("https://" + window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>").then(() => {})
}
}
});
@@ -1749,7 +1776,7 @@ checkbox.addEventListener('change', function(e) {
if (/[?&]autoplay=/.test(location.search)) {
checkbox.checked = true;
console.log("[AUTOPLAY] enabled");
- let url = window.location.hostname + "/watch?v=<%- k.Video.Recommendations?.Video[0].id%>";
+ let url = window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>";
document.body.style.cursor = "wait"; // set cursor to "wait" before the fetch request starts
fetch(url)
.then(response => response.json())
@@ -1764,11 +1791,11 @@ if (/[?&]autoplay=/.test(location.search)) {
document.getElementById('video').addEventListener('ended', autoplaynextvideo, false);
if (/[?&]autoplay=/.test(location.search)) {
if (checkbox.checked) {
- fetch("https://" + window.location.hostname + "/watch?v=<%- k.Video.Recommendations?.Video[0].id%>").then(() => {})
+ fetch("https://" + window.location.hostname + "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>").then(() => {})
}
}
function autoplaynextvideo(e) {
- location.href = "/watch?v=<%- k.Video.Recommendations?.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>";
+ location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>";
}
}
<% } %>
@@ -2872,33 +2899,32 @@ More Epic options owo~
<% if (!f) { %>
- <% k?.Video.Recommendations.Video.forEach(x => { %>
-
-
- <% }) %>
+ <% inv_vid?.recommendedVideos.forEach(x => { %>
+
+ <% }) %>
<% } %>
<% if (f) { %>
@@ -3044,7 +3070,7 @@ checkbox.addEventListener('change', function(e) {
document.getElementById('video').addEventListener('ended',autoplaynextvideo,false);
function autoplaynextvideo(e) {
- location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>"
+ location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>"
}
}
@@ -3064,7 +3090,7 @@ if (/[?&]autoplay=/.test(location.search)) {
document.getElementById('video').addEventListener('ended',autoplaynextvideo,false);
function autoplaynextvideo(e) {
- location.href = "/watch?v=<%- k.Video.Recommendations.Video[0].id%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + k.Video.Recommendations.Video[0].id ) %>"
+ location.href = "/watch?v=<%- inv_vid?.recommendedVideos[0].videoId%>&autoplay=<%-btoa("1f739d935676111cfff4b4693e3816e664797050" + inv_vid?.recommendedVideos[0].videoId) %>"
}
}
var anchor = document.getElementById("sub");