A clean and minimal youtube frontend, without all the ads and whistles
JavaScript
fix: two step update video, downloaded only after also transcoded
Christian Feif636fa92699a
diff --git a/client/main.css b/client/main.cssindex c250818..379b42f 100644--- a/client/main.css+++ b/client/main.css@@ -279,7 +279,7 @@ video-element, video-element video {overflow: hidden;overflow-y: auto;z-index: 9000;- max-height: 8rem;+ max-height: 10rem;font-size: 1rem;padding: 0.5rem;background-color: white;diff --git a/lib/youtube.js b/lib/youtube.jsindex edbd91a..d0535f1 100644--- a/lib/youtube.js+++ b/lib/youtube.js@@ -33,8 +33,8 @@ export async function downloadVideo(id, repo, callback = () => {}) {repo.upsertVideos([video])callback(`downloaded external video ${id}`)}- const video = repo.updateVideo(id, {downloaded: true, location, format})-+ const video = repo.updateVideo(id, {location, format})+if (process.env.SKIP_TRANSCODING !== 'true' && video.location && video.format) {for await (const line of ffmpeg.transcode(video.location, video.format)) {console.log(line)@@ -46,6 +46,8 @@ export async function downloadVideo(id, repo, callback = () => {}) {callback(`successfully transcoded video ${video.location}`)}+ repo.updateVideo(id, {downloaded: true})+normalizeSubtitleFiles(id)resolve(id)} catch (error) {