A clean and minimal youtube frontend, without all the ads and whistles
JavaScript
refactor: replace extension with regex
Christian Feia8a8954a0e07
diff --git a/lib/repository.js b/lib/repository.jsindex 68b259f..fda88f5 100644--- a/lib/repository.js+++ b/lib/repository.js@@ -33,7 +33,7 @@ export default class Repository {fs.readdirSync(`${this.basePath}/videos`).forEach(file => {const format = file.substring(file.lastIndexOf('.') + 1)if (!['mp4', 'webm'].includes(format)) return- const videoId = file.replace('.mp4', '').replace('.webm', '')+ const videoId = file.replace(/\.(webm|mp4)$/, '')const location = `${this.basePath}/videos/${file}`this.updateVideo(videoId, {downloaded: true, location, format})})diff --git a/lib/yt-dlp.js b/lib/yt-dlp.jsindex 13332f0..6da795f 100644--- a/lib/yt-dlp.js+++ b/lib/yt-dlp.js@@ -19,10 +19,10 @@ const videoYTDLPArgs = quality => ['1','--sponsorblock-remove','sponsor',- '--sponsorblock-mark',- 'all',+ // '--sponsorblock-mark',+ // 'all','--merge-output-format',- 'webm/mp4',+ 'mp4','-f',`bestvideo[height<=${quality}]+bestaudio/best[height<=${quality}]`,]