Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

feat: go back 6 months looking for channel videos

Christian Fei0e2f79de9ede
diff --git a/lib/youtube.js b/lib/youtube.js
index 52785ed..9e67944 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -109,7 +109,7 @@ 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(v => v.publishedAt > new Date(Date.now() - 6 * 31 * 24 * 60 * 60 * 1000))
// .filter((_,i) => i < 10)
} catch (error) {
console.error('Error fetching latest video:', error.message)