File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,18 +74,20 @@ function json(str: string) {
7474
7575export 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
You can’t perform that action at this time.
0 commit comments