0

optional delay between downloads

This commit is contained in:
Kaimi
2015-10-22 14:59:54 +03:00
parent df7c3c81c2
commit fe50bbca89
2 changed files with 7 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ ya.pl [-adkpt] [long options...]
--proxy HTTP-proxy (format: 1.2.3.4:8888) --proxy HTTP-proxy (format: 1.2.3.4:8888)
--exclude skip tracks specified in file --exclude skip tracks specified in file
--include download only tracks specified in file --include download only tracks specified in file
--delay delay between downloads (in seconds)
--debug print debug info during work --debug print debug info during work
--help print usage --help print usage

View File

@@ -170,6 +170,7 @@ my ($opt, $usage) = Getopt::Long::Descriptive::describe_options
['proxy=s', 'HTTP-proxy (format: 1.2.3.4:8888)'], ['proxy=s', 'HTTP-proxy (format: 1.2.3.4:8888)'],
['exclude=s', 'skip tracks specified in file'], ['exclude=s', 'skip tracks specified in file'],
['include=s', 'download only 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'], ['debug', 'print debug info during work'],
['help', 'print usage'], ['help', 'print usage'],
@@ -324,6 +325,11 @@ if($opt{album} || ($opt{playlist} && $opt{kind}))
} }
fetch_track($track_info_ref); fetch_track($track_info_ref);
if($opt{delay})
{
sleep $opt{delay};
}
} }
info(OK, 'Done!'); info(OK, 'Done!');