Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

display max 1000 videos, show more videos of single channel without 31 days cutoff

Christian Feia28ef12aa0ac
diff --git a/client/main.js b/client/main.js
index 0ac6127..188d7ce 100644
--- a/client/main.js
+++ b/client/main.js
@@ -30,7 +30,7 @@ eventSource.onmessage = (message) => {
const allVideos = data.videos
.filter(video => video.title.split(' ').every(word => !ignoredTerms.includes(word.toLowerCase().replace(/('s|"|,|:)/,''))))
.sort((a, b) => +new Date(b.publishedAt) - +new Date(a.publishedAt))
- .filter((_, i) => i < 300)
+ .filter((_, i) => i < 1000)
allVideos.forEach(video => $videosContainer.appendChild(createVideoElement(video)))
diff --git a/lib/youtube.js b/lib/youtube.js
index bc293cf..285e26c 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -78,8 +78,8 @@ export async function getVideosFor(channelName) {
return videoContents
.map(toInternalVideo)
.filter(Boolean)
- .filter(v => v.publishedAt > new Date(Date.now() - 31 * 24 * 60 * 60 * 1000))
- .filter((_,i) => i < 10)
+ // .filter(v => v.publishedAt > new Date(Date.now() - 31 * 24 * 60 * 60 * 1000))
+ // .filter((_,i) => i < 10)
} catch (error) {
console.error('Error fetching latest video:', error.message)
return null