Set download speed using LWP - Perl

I am developing an application that downloads files from the Internet; files are mainly located in ftp servers , I use the LWP::Simplefunction getstoreto extract files as well. But I would like to limit the download speed, for example, in wget...

Have you seen something similar to --limit-ratefrom wgetimplemented in LWPor LWP::Simple??

thank

+3
source share
3 answers

If your main problems are FTP servers, maybe look at Net :: FTP :: Throttle . You can set the maximum speed in the constructor.

+2
source

There is no such option.

, ( sleep()), , .

, LWP. , wget, curl . , WWW:: Curl.

: .

+2

... Or you can use LWP over libcurl :)

#!/usr/bin/env perl
use common::sense;

use LWP::Protocol::Net::Curl MAX_RECV_SPEED_LARGE => 10240; # 10 KB/s
use LWP::Simple;

getstore 'http://www.cpan.org/src/5.0/perl-5.16.2.tar.gz' => 'perl.tar.gz';
0
source

All Articles