File tree 4 files changed +27
-3
lines changed
4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -328,7 +328,9 @@ static int m3u8download_pollqeue(
328
328
}
329
329
}
330
330
331
- (* options -> progress_callback )(qeue -> offset , current );
331
+ if (options -> progress_callback != NULL ) {
332
+ (* options -> progress_callback )(qeue -> offset , current );
333
+ }
332
334
333
335
while (running ) {
334
336
CURLMcode mc = curl_multi_perform (curl_multi , & running );
@@ -387,7 +389,10 @@ static int m3u8download_pollqeue(
387
389
curl_multi_add_handle (curl_multi , msg -> easy_handle );
388
390
} else {
389
391
current ++ ;
390
- (* options -> progress_callback )(qeue -> offset , current );
392
+
393
+ if (options -> progress_callback != NULL ) {
394
+ (* options -> progress_callback )(qeue -> offset , current );
395
+ }
391
396
}
392
397
}
393
398
Original file line number Diff line number Diff line change @@ -161,6 +161,7 @@ int main(int argc, argv_t* argv[]) {
161
161
int insecure = 0 ;
162
162
int debug = 0 ;
163
163
int disable_autoselection = 0 ;
164
+ int disable_progress = 0 ;
164
165
165
166
int select_all_medias = 0 ;
166
167
int exists = 0 ;
@@ -610,6 +611,15 @@ int main(int argc, argv_t* argv[]) {
610
611
}
611
612
612
613
disable_autoselection = 1 ;
614
+ } else if (strcmp (argument -> key , "disable-progress-meter" ) == 0 ) {
615
+ if (disable_progress ) {
616
+ err = M3U8ERR_CLI_DUPLICATE_ARGUMENT ;
617
+ goto end ;
618
+ }
619
+
620
+ download_options .progress_callback = NULL ;
621
+
622
+ disable_progress = 1 ;
613
623
} else {
614
624
err = M3U8ERR_CLI_ARGUMENT_INVALID ;
615
625
goto end ;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ This file is auto-generated. Use the ../tools/program_help.h.py tool to regenera
6
6
#define PROGRAM_HELP_H
7
7
8
8
#define PROGRAM_HELP \
9
- "usage: kai [-h] [-v] -u URL [-k] [-A USER_AGENT] [-x URI] [--doh-url URL] [-e URL] [-r COUNT] [--debug] [-S] [--select-media MEDIA] [--select-stream VARIANT_STREAM] [--disable-autoselection] [-c CONCURRENCY] -o FILENAME\n" \
9
+ "usage: kai [-h] [-v] -u URL [-k] [-A USER_AGENT] [-x URI] [--doh-url URL] [-e URL] [-r COUNT] [--debug] [-S] [--select-media MEDIA] [--select-stream VARIANT_STREAM] [--disable-autoselection] [--disable-progress-meter] [- c CONCURRENCY] -o FILENAME\n" \
10
10
"\n" \
11
11
"A command-line utility to download contents from M3U8 playlists.\n" \
12
12
"\n" \
@@ -30,6 +30,8 @@ This file is auto-generated. Use the ../tools/program_help.h.py tool to regenera
30
30
" Select which variant stream to download. Defaults to the variant stream with the highest bandwidth (bits per second).\n" \
31
31
" --disable-autoselection\n" \
32
32
" Avoid autoselection of streams based on predefined preferences set by the master playlist.\n" \
33
+ " --disable-progress-meter\n" \
34
+ " Disable showing download progress meter.\n" \
33
35
" -c CONCURRENCY, --concurrency CONCURRENCY\n" \
34
36
" Specify how many media segments should be downloaded simultaneously. Defaults to 1.\n" \
35
37
" -o FILENAME, --output FILENAME\n" \
Original file line number Diff line number Diff line change 116
116
help = "Avoid autoselection of streams based on predefined preferences set by the master playlist."
117
117
)
118
118
119
+ parser .add_argument (
120
+ "--disable-progress-meter" ,
121
+ required = False ,
122
+ action = "store_true" ,
123
+ help = "Disable showing download progress meter."
124
+ )
125
+
119
126
parser .add_argument (
120
127
"-c" ,
121
128
"--concurrency" ,
You can’t perform that action at this time.
0 commit comments