Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

chore: wip toInternalVideo using yt-dlp

Christian Feia1bcd149f529
diff --git a/lib/youtube.js b/lib/youtube.js
index f413d47..b68f465 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -120,17 +120,18 @@ export async function getVideosFor(channelName) {
if (!v || !v.richItemRenderer) return
const data = v.richItemRenderer.content.videoRenderer
if (!data.viewCountText?.simpleText) return
+ // comments contain yt-dlp info downloaded with -J
return {
channelName,
- title: data.title?.runs[0].text,
- url: `https://www.youtube.com/watch?v=${data.videoId}`,
+ title: data.title?.runs[0].text, //.title
+ url: `https://www.youtube.com/watch?v=${data.videoId}`, // .url
thumbnail: `https://img.youtube.com/vi/${data.videoId}/mq2.jpg`,
- description: data.descriptionSnippet?.runs[0].text,
- id: data.videoId,
+ description: data.descriptionSnippet?.runs[0].text, // .description
+ id: data.videoId, // .id
publishedTime: data.publishedTimeText?.simpleText,
publishedAt: parseRelativeTime(data.publishedTimeText?.simpleText),
- viewCount: data.viewCountText?.simpleText,
- duration: data.lengthText?.simpleText,
+ viewCount: data.viewCountText?.simpleText, // .view_count
+ duration: data.lengthText?.simpleText, // .duration_string
}
}
}