Skip to content

armgit / my-yt

Public Imported from GitHub
0

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

JavaScript

fix: yt-dlp outputting warning

Christian Fei9be17ca377f1
diff --git a/lib/youtube.js b/lib/youtube.js
index cc86306..b989885 100644
--- a/lib/youtube.js
+++ b/lib/youtube.js
@@ -137,7 +137,8 @@ export async function getVideo (id) {
if (isUnsupportedUrl(id)) return null
if (isYouTubeUrl(id)) id = extractIdFromUrl(id)
try {
- const {output} = await spawn('yt-dlp', ['-j', '--', id])
+ let {output} = await spawn('yt-dlp', ['-j', '--', id])
+ output = output.split('\n').filter(l => l.startsWith('{'))
const json = JSON.parse(output)
return {
channelName: json.uploader_id.replace(/^@/, ''),