Skip to content

Commit d1d2656

Browse files
committed
Improve downloadExecutable logging for yt-dlp download process
1 parent 8a9df0d commit d1d2656

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/utils/yt-dlp.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,18 +74,20 @@ function json(str: string) {
7474

7575
export async function downloadExecutable() {
7676
if (!existsSync(exePath)) {
77-
logger.info("Yt-dlp couldn't be found, trying to download...");
77+
logger.info("yt-dlp not found, downloading...");
7878
const releases = await got.get("https://api.github.com/repos/yt-dlp/yt-dlp/releases?per_page=1").json();
7979
const release = releases[0];
8080
const asset = release.assets.find(ast => ast.name === filename);
81+
const version = release.tag_name;
82+
8183
await new Promise((resolve, reject) => {
8284
got.get(asset.browser_download_url).buffer().then(x => {
8385
mkdirSync(scriptsPath, { recursive: true });
8486
writeFileSync(exePath, x, { mode: 0o777 });
8587
return 0;
8688
}).then(resolve).catch(reject);
8789
});
88-
logger.info("Yt-dlp has been downloaded.");
90+
logger.info(`yt-dlp ${version} downloaded successfully`);
8991
}
9092
}
9193

0 commit comments

Comments
 (0)