Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Download only part of a file from the web

by Anonymous Monk
on May 10, 2007 at 04:49 UTC ( [id://614544]=note: print w/replies, xml ) Need Help??


in reply to Download only part of a file from the web

Re: Download resumer
  • Comment on Re: Download only part of a file from the web

Replies are listed 'Best First'.
Re^2: Download only part of a file from the web
by avid (Novice) on Dec 30, 2008 at 20:58 UTC
    Any update? Or does anyone know of any tool that allows restricting the download size?

    I am also trying to write a tool to automate analysis of flv files on the web. The clip analysis can be done with a header preview, so I want similar functionality to avoid full download.

    Best regards,
    -Avid (seeker of perl wisdom)
      LWP::UserAgent has a max_size method that can limit the size that will be retrieved to a fixed number of bytes.

      Or you can be more ambitious and pass a :content_cb callback to the get method. This will give you the response in chunks and you can then accumulate them in a variable. When your analysis says that you have enough you can die to end the request, and catch that at a higher level with an eval. This will be a lot more complex, but avoids having to guess how much of the file to download.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://614544]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2024-04-16 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found