cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: python -> curl -> download all files

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Tue, 22 Jul 2008 16:21:38 -0500

On Tue, Jul 22, 2008 at 2:55 PM, Lukasz Szybalski <szybalski_at_gmail.com>
wrote:

> On Fri, Jul 11, 2008 at 10:43 AM, Ralph Mitchell
> <ralphmitchell_at_gmail.com> wrote:
> > On Fri, Jul 11, 2008 at 10:30 AM, Lukasz Szybalski <szybalski_at_gmail.com>
> > wrote:
> >>
> >> Hello,
> >> I was wondering if anybody has a python script to download files using
> >> curl.
> >>
> >> I saw there was a perl scrip but if any of you has it in python that
> >> would be great. I could then import it from my app.
> >>
> >> Ideas, links?
> >
> > You could start here:
> >
> > http://pycurl.sourceforge.net/
> >
>
>
> Since I wasn't able to get an example on how to do files in pycurl,
> here is the sh script:
>
> """
> for i in `curl -E certkey.pem -k -s -u user:pass
> ftp://www.somesite.com/ --ftp-ssl --list-only`;
> do `curl -E certkey.pem -k -s -B -O -u user:pass
> ftp://www.somesite.com/$i --ftp-ssl`;mv $i ../download/$(date
> +%Y%m%d)_$i ;done
> """
>

Under "Documentation" on the pycurl page:

   "PycURL now includes API documentation in the
*doc<http://pycurl.sourceforge.net/doc/pycurl.html>
* directory of the distribution, as well as a number of test and example
scripts in the *tests<http://pycurl.cvs.sourceforge.net/pycurl/pycurl/tests/>
* and *examples
<http://pycurl.cvs.sourceforge.net/pycurl/pycurl/examples/>*directories
of the distribution. "

If you follow the "tests" link, about the 5th test down is "test_ftp.py":

http://pycurl.cvs.sourceforge.net/pycurl/pycurl/tests/test_ftp.py?revision=1.1&view=markup

That's about as far as I go - I don't use curl for ftp or python for
anything...

Ralph Mitchell

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2008-07-22