mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-14 05:28:58 +01:00
fix reccomendations
This commit is contained in:
parent
5ca70870d7
commit
91dcd8ec7b
1 changed files with 64 additions and 38 deletions
|
@ -1601,7 +1601,34 @@ Recommended Videos
|
||||||
|
|
||||||
|
|
||||||
<% if (!f) { %>
|
<% if (!f) { %>
|
||||||
<% k.Video.Recommendations?.Video?.forEach(x => { %> <div class="fade-in video"> <% if (!optout) { %><a class="thumbnail" href="/watch?v=<%= x.id %>" style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.id %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px" alt="<%= x.Title %>"><span class="video-length"><%- x.duration || "LIVE"%></span><% } %><% if (optout) { %><a class="thumbnail"href="/watch?v=<%= x.id %>&m=f"style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.id %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px"alt="<%= x.Title %>"><span class="video-length"><%- x.duration || "LIVE"%></span><% } %></a><div class="info"><% if (!optout) { %><a class="max-lines-2 title" href="/watch?v=<%= x.id %>" style="font-stretch:ultra-expanded;font-weight:850" title="<%= x.Title %>"><%= x.Title %></a><% } %><% if (optout) { %><a class="max-lines-2 title" href="/watch?v=<%= x.id %>&m=f" style="font-stretch:100%;font-weight:800" title="<%= x.Title %>"><%= x.Title %></a><% } %><div><a class="max-lines-2" href="/channel?id=<%= x.Channel.id %>@youtube.com" style="-webkit-line-clamp:1;width:12em;word-wrap:break-word"><%=x.Channel.Name %></a><div class="video-views"><% if (universe) { %><%= x.uploadedAt.replace("Streamed ", " ") %> <br> <%= convert(x.views) %> views <% } %> <% if (!universe) { %><%= x.uploadedAt.replace("Streamed", " ") %> • <%= convert(x.views) %> views <% } %> </div></div></div></div><% }) %><% } %>
|
<% inv_vid?.recommendedVideos.forEach(x => { %>
|
||||||
|
<div class="fade-in video">
|
||||||
|
<% if (!optout) { %><a class="thumbnail" href="/watch?v=<%= x.videoId %>" style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px" alt="<%= x.Title %>"><span class="video-length"><%- turntomins(x.lengthSeconds) || "LIVE"%></span><% } %><% if (optout) { %><a class="thumbnail"href="/watch?v=<%= x.videoId %>&m=f"style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px"alt="<%= x.Title %>"><span class="video-length"><%- x.duration || "LIVE"%></span><% } %></a>
|
||||||
|
<div class="info">
|
||||||
|
<% if (!optout) { %>
|
||||||
|
<a class="max-lines-2 title" href="/watch?v=<%= x.videoId %>" style="font-stretch:ultra-expanded;font-weight:850" title="<%= x.Title %>">
|
||||||
|
<%= x.title %>
|
||||||
|
</a>
|
||||||
|
<% } %>
|
||||||
|
<% if (optout) { %>
|
||||||
|
<a class="max-lines-2 title" href="/watch?v=<%= x.videoId %>&m=f" style="font-stretch:100%;font-weight:800" title="<%= x.Title %>">
|
||||||
|
<%= x.title %>
|
||||||
|
</a>
|
||||||
|
<% } %>
|
||||||
|
<div>
|
||||||
|
<a class="max-lines-2" href="/channel?id=<%= x.authorId %>@youtube.com" style="-webkit-line-clamp:1;width:12em;word-wrap:break-word">
|
||||||
|
<%=x.author %>
|
||||||
|
</a>
|
||||||
|
<div class="video-views">
|
||||||
|
|
||||||
|
<%= convert(x.viewCount) %> views
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% }) %>
|
||||||
|
<% } %>
|
||||||
|
|
||||||
<% if (f) { %>
|
<% if (f) { %>
|
||||||
|
|
||||||
|
@ -1703,7 +1730,7 @@ Recommended Videos
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<% if (k.Video.Recommendations.Video) { %>
|
<% if (inv_vid?.recommendedVideos) { %>
|
||||||
|
|
||||||
let checkbox = document.getElementById("continue");
|
let checkbox = document.getElementById("continue");
|
||||||
|
|
||||||
|
@ -1711,10 +1738,10 @@ checkbox.addEventListener('change', function(e) {
|
||||||
if (checkbox.checked) {
|
if (checkbox.checked) {
|
||||||
console.log("[AUTOPLAY] enabled");
|
console.log("[AUTOPLAY] enabled");
|
||||||
document.getElementById('video').addEventListener('ended', autoplaynextvideo, false);
|
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) {
|
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)) {
|
if (/[?&]autoplay=/.test(location.search)) {
|
||||||
|
@ -1725,7 +1752,7 @@ checkbox.addEventListener('change', function(e) {
|
||||||
|
|
||||||
if (/[?&]autoplay=/.test(location.search)) {
|
if (/[?&]autoplay=/.test(location.search)) {
|
||||||
if (checkbox.checked) {
|
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)) {
|
if (/[?&]autoplay=/.test(location.search)) {
|
||||||
checkbox.checked = true;
|
checkbox.checked = true;
|
||||||
console.log("[AUTOPLAY] enabled");
|
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
|
document.body.style.cursor = "wait"; // set cursor to "wait" before the fetch request starts
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
|
@ -1764,11 +1791,11 @@ if (/[?&]autoplay=/.test(location.search)) {
|
||||||
document.getElementById('video').addEventListener('ended', autoplaynextvideo, false);
|
document.getElementById('video').addEventListener('ended', autoplaynextvideo, false);
|
||||||
if (/[?&]autoplay=/.test(location.search)) {
|
if (/[?&]autoplay=/.test(location.search)) {
|
||||||
if (checkbox.checked) {
|
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) {
|
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,32 +2899,31 @@ More Epic options owo~
|
||||||
|
|
||||||
|
|
||||||
<% if (!f) { %>
|
<% if (!f) { %>
|
||||||
<% k?.Video.Recommendations.Video.forEach(x => { %>
|
<% inv_vid?.recommendedVideos.forEach(x => { %>
|
||||||
<div class="video">
|
<div class="fade-in video">
|
||||||
<% if (!optout) { %>
|
<% if (!optout) { %><a class="thumbnail" href="/watch?v=<%= x.videoId %>" style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px" alt="<%= x.Title %>"><span class="video-length"><%- turntomins(x.lengthSeconds) || "LIVE"%></span><% } %><% if (optout) { %><a class="thumbnail"href="/watch?v=<%= x.videoId %>&m=f"style="background-image:url(<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.videoId %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw);border-radius:9.5px"alt="<%= x.Title %>"><span class="video-length"><%- x.duration || "LIVE"%></span><% } %></a>
|
||||||
|
|
||||||
<a href="/watch?v=<%= x.id %>" class="thumbnail" style="background-image: url('<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.id %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw');border-radius: 9.5px;border: 2px solid white;" > <span class="video-length"><%=x.duration %></span>
|
|
||||||
<% } %>
|
|
||||||
<% if (optout) { %>
|
|
||||||
|
|
||||||
<a href="/watch?v=<%= x.id %>&m=f" class="thumbnail" style="background-image: url('<%- media_proxy_url %>/proxy?url=https://vid.puffyan.us/vi/<%= x.id %>/hqdefault.jpg?sqp=-oaymwEbCKgBEF5IVfKriqkDDggBFQAAiEIYAXABwAEG&rs=AOn4CLBy_x4UUHLNDZtJtH0PXeQGoRFTgw');border-radius: 9.5px;border: 2px solid white;" > <span class="video-length"><%=x.duration %></span>
|
|
||||||
<% } %>
|
|
||||||
</a>
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
|
|
||||||
<% if (!optout) { %>
|
<% if (!optout) { %>
|
||||||
<a href="/watch?v=<%= x.id %>" class="title max-lines-2" style="margin-top: 4px;"><%= x.Title %></a>
|
<a class="max-lines-2 title" href="/watch?v=<%= x.videoId %>" style="font-stretch:ultra-expanded;font-weight:850" title="<%= x.Title %>">
|
||||||
|
<%= x.title %>
|
||||||
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<% if (optout) { %>
|
<% if (optout) { %>
|
||||||
<a href="/watch?v=<%= x.id %>&m=f" style="margin-top: 4px;" class="title max-lines-2"><%= x.Title %></a>
|
<a class="max-lines-2 title" href="/watch?v=<%= x.videoId %>&m=f" style="font-stretch:100%;font-weight:800" title="<%= x.Title %>">
|
||||||
|
<%= x.title %>
|
||||||
|
</a>
|
||||||
<% } %>
|
<% } %>
|
||||||
<div style="color:#fff" >
|
<div>
|
||||||
<a class="max-lines-2" style="color:#fff" href="/channel?id=<%= x.Channel.id %>"><%=x.Channel.Name %></a> • <div>
|
<a class="max-lines-2" href="/channel?id=<%= x.authorId %>@youtube.com" style="-webkit-line-clamp:1;width:12em;word-wrap:break-word;acolor:#fff">
|
||||||
<%= x.uploadedAt %> </div>
|
<%=x.author %>
|
||||||
</div>
|
</a>
|
||||||
</div>
|
<div class="video-views">
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<% }) %>
|
<% }) %>
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
||||||
|
@ -3044,7 +3070,7 @@ checkbox.addEventListener('change', function(e) {
|
||||||
document.getElementById('video').addEventListener('ended',autoplaynextvideo,false);
|
document.getElementById('video').addEventListener('ended',autoplaynextvideo,false);
|
||||||
|
|
||||||
function autoplaynextvideo(e) {
|
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);
|
document.getElementById('video').addEventListener('ended',autoplaynextvideo,false);
|
||||||
|
|
||||||
function autoplaynextvideo(e) {
|
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");
|
var anchor = document.getElementById("sub");
|
||||||
|
|
Loading…
Reference in a new issue