From 650fde3169a78f55f3ed5006b094dc02c9c7dfb8 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sun, 2 Apr 2023 11:58:31 +0000 Subject: [PATCH] fix the video object retuning undefined --- html/poketube.ejs | 58 +++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 32 deletions(-) diff --git a/html/poketube.ejs b/html/poketube.ejs index 024826b6..b41e2723 100644 --- a/html/poketube.ejs +++ b/html/poketube.ejs @@ -650,10 +650,10 @@ display: block; !important;" autoplay controls <% } %> - <% if ( video.Subtitles.Subtitle) { %> + <% if ( video?.Subtitles?.Subtitle) { %> <% if (Array.isArray( video.Subtitles.Subtitle)) { %> - <% video.Subtitles.Subtitle.forEach(x => { %> + <% video?.Subtitles?.Subtitle?.forEach(x => { %> " kind="subtitles"> @@ -739,8 +739,8 @@ display: block; !important;" autoplay controls
- title="Non-Translated title : <%=video.Title%>" + <% if (video?.Title !== k.Video.Title) { %> + title="Non-Translated title : <%=video?.Title%>" <% } %> > <%-k.Video.Title%>
@@ -749,7 +749,7 @@ display: block; !important;" autoplay controls
- +
@@ -758,7 +758,7 @@ display: block; !important;" autoplay controls <%=k.Video.Channel.Name%> - <% if (!video.Channel.Name.endsWith(' - Topic')) { %> + <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> <% if (badges) { %> <% if (badges.tooltip === "Verified") { %> @@ -777,7 +777,7 @@ display: block; !important;" autoplay controls
- +
@@ -813,7 +813,7 @@ display: block; !important;" autoplay controls
- <% if (!video.Channel.Name.endsWith(' - Topic')) { %> + <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> <% if (!inv_vid.title.endsWith('Audio)')) { %> <% if (support != undefined) { %> @@ -835,7 +835,7 @@ display: block; !important;" autoplay controls <% if (support == undefined) { %> - <% if (!video.Channel.Name.endsWith(' - Topic')) { %> + <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> <% if (!inv_vid.title.endsWith('Audio)')) { %>
@@ -851,9 +851,9 @@ display: block; !important;" autoplay controls <% }%> <% }%> - <% }%> <% if (video.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> + <% }%> <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - <% if (video.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> + <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> <% } %> <% } %> <% } %> - <% } %> - + - <% if (String(video.Description) == "[object Object]") { %> - <% if (String(inv_vid.descriptionHtml) == " ") { %> + <% if (String(inv_vid.description) == " ") { %>

No Description On this Video ( sad innit :c )

- <% } %> - <% } %> + <% } %> <% if (wiki.extract_html) { %> @@ -971,12 +965,12 @@ display: block; !important;" autoplay controls
- <% if (Array.isArray(video.Tags.Tag)) { %> + <% if (Array.isArray(video?.Tags.Tag)) { %>
Tags
- <% video.Tags.Tag.forEach(x => { %> + <% video?.Tags.Tag.forEach(x => { %>
<%=x %> @@ -1031,7 +1025,7 @@ display: block; !important;" autoplay controls - <% if (!video.Channel.Name.endsWith(' - Topic')) { %> + <% if (!video?.Channel.Name.endsWith(' - Topic')) { %> <% if (!inv_vid.title.endsWith('Audio)')) { %> @@ -1040,9 +1034,9 @@ display: block; !important;" autoplay controls <% }%> <% }%> - <% if (video.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> + <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> - <% if (video.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> + <% if (video?.Channel.Name.endsWith(' - Topic') || inv_vid.title.endsWith('Audio)')) { %> Open In Music Player @@ -1202,8 +1196,8 @@ display: block; !important;" autoplay controls Recommended Videos
- - From <%=video.Channel.Name %> + + From <%=k.Video.Channel.Name%>
@@ -1645,7 +1639,7 @@ videoElement.addEventListener("fullscreenchange", () => { - +