File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -125,7 +125,9 @@ export class YouTubeDownloader implements API {
125125
126126 const videoStream = ytdl ( url , { format : videoFormat } ) ;
127127 const audioStream = ytdl ( url , { format : audioFormat } ) ;
128-
128+ videoStream . once ( "readable" , ( ) => {
129+ startCallback ?.( ) ;
130+ } ) ;
129131 videoStream . on ( "progress" , ( _ , downloaded , total ) => {
130132 videoDownloaded += downloaded ;
131133 const now = Date . now ( ) ;
Original file line number Diff line number Diff line change 11{
22 "name" : " @kunkun/kunkun-ext-youtube-downloader" ,
3- "version" : " 0.1.1 " ,
3+ "version" : " 0.1.2 " ,
44 "license" : " MIT" ,
55 "exports" : " ./mod.ts" ,
66 "imports" : {
Original file line number Diff line number Diff line change 11{
22 "$schema" : " https://schema.kunkun.sh" ,
33 "name" : " kunkun-ext-youtube-dowloader" ,
4- "version" : " 0.1.1 " ,
4+ "version" : " 0.1.2 " ,
55 "license" : " MIT" ,
66 "type" : " module" ,
77 "kunkun" : {
Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ class DownloadYouTubeExtension extends WorkerExtension {
180180 }
181181
182182 let url = await clipboard . readText ( ) ;
183- // url = "https://youtu.be/-b1FogYHTZc"; // for development only
183+ url = "https://youtu.be/-b1FogYHTZc" ; // for development only
184184 // check if url is a valid youtube url
185185 if ( ! url . includes ( "youtube.com" ) && ! url . includes ( "youtu.be" ) ) {
186186 toast . warning ( "Invalid YouTube URL from clipboard" ) ;
@@ -189,8 +189,10 @@ class DownloadYouTubeExtension extends WorkerExtension {
189189 const formats = await this . rpc . api . getAvailableResolutions ( url ) ;
190190 const form = new Form . Form ( {
191191 title : "Download YouTube Video" ,
192- description : "Please copy a YouTube URL then enter this extension." ,
193- key : "form1" ,
192+ description : `Please copy a YouTube URL then enter this extension.
193+ High Resolution video (e.g. 4K) could take a very long time to download, please be patient.
194+ A progress bar with estimated time isn't implemented yet. There is a loading bar on the top.` ,
195+ key : "download-youtube-video" ,
194196 showFormDataDebug : true ,
195197 submitBtnText : "Download" ,
196198 fields : [
You can’t perform that action at this time.
0 commit comments