From 1366284453b87c16ffc5019f8e091e1dff627129 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 22 Jan 2023 22:37:37 -0500 Subject: [PATCH] Fix for sync script --- scripts/profile-sync.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/profile-sync.js b/scripts/profile-sync.js index 93bba34a..f8146379 100644 --- a/scripts/profile-sync.js +++ b/scripts/profile-sync.js @@ -91,7 +91,15 @@ async function extractVideos(sourceUrl, browser = undefined, limit = 100) { if (videos.length > limit) { return; } - videos.push(data.toString().trim()) + newVideos = data.toString() + .split('\n') + .map(video => video.trim()) + .filter(i => i); + + newVideos.forEach(video => { + videos.push(video) + }); + if (videos.length >= limit) { ytDlpProcess.kill() }