0

Possible Duplicate:
Stream large binary files with urllib2 to file

I want to make a video downloader which when given the url of a page which has a video to stream can download the video.

So what i thought was if i get the video stream, i can copy the content into a string and then copy it into file . How can i do it in python?Is there any library in python which can help?

Community
  • 1
  • 1

1 Answers1

0

for python 2.x

urllib

Use method urlretrieve

Fred
  • 1,011
  • 1
  • 10
  • 36
  • it is used if the url denotes a file while in video streaming it is diffrent from what i understood.. –  Feb 24 '12 at 21:27
  • The second argument, if present, specifies the file location to copy to (if absent, the location will be a tempfile with a generated name). The third argument, if present, is a hook function that will be called once on establishment of the network connection and once after each block read thereafter. The hook will be passed three arguments; a count of blocks transferred so far, a block size in bytes, and the total size of the file. The third argument may be -1 on older FTP servers which do not return a file size in response to a retrieval request. http://docs.python.org/library/urllib.html – nisc Feb 24 '12 at 22:03