diff --git a/README.md b/README.md index a4361ee..49068e7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ ya.pl [-adkpt] [long options...] --proxy HTTP-proxy (format: 1.2.3.4:8888) --exclude skip tracks specified in file --include download only tracks specified in file + --delay delay between downloads (in seconds) --debug print debug info during work --help print usage diff --git a/src/ya.pl b/src/ya.pl index 531868f..e8cd2f4 100755 --- a/src/ya.pl +++ b/src/ya.pl @@ -170,6 +170,7 @@ my ($opt, $usage) = Getopt::Long::Descriptive::describe_options ['proxy=s', 'HTTP-proxy (format: 1.2.3.4:8888)'], ['exclude=s', 'skip tracks specified in file'], ['include=s', 'download only tracks specified in file'], + ['delay=i', 'delay between downloads (in seconds)'], [], ['debug', 'print debug info during work'], ['help', 'print usage'], @@ -324,6 +325,11 @@ if($opt{album} || ($opt{playlist} && $opt{kind})) } fetch_track($track_info_ref); + + if($opt{delay}) + { + sleep $opt{delay}; + } } info(OK, 'Done!');