0

I have a curl command which is having some issues sending data to proxy, so sometimes it sends the data perfectly other times it fails. The command looks like

curl --tlsv1 --cipher ALL --connect-timeout 90 -T nint.txt  ftps://ftp.box.com/Backup/nants.txt --user "admin:pass" -x socks4://10.21.0.10:1080 -v

Now i need to write a python code which executes this command until the output contains Connection #0 to host ftp.box.com left intact

something like

def send_to_box(zip_name):
    curl --tlsv1 --cipher ALL --connect-timeout 90 -T nint.txt  ftps://ftp.box.com/Backup/nants.txt --user "admin:pass" -x socks4://10.21.0.10:1080  2>&1 | grep -q "Connection #0 to host ftp.box.com left intact" "
    while "Connection #0 to host ftp.box.com left intact" in os.system(curl_cmd_grep):
           print successful send the data

Not sure what is the best way to achive this

Kittystone
  • 661
  • 3
  • 9
  • 28

1 Answers1

0

You can use ftputil which has a TLS support. See an example here: Does ftputil support SSL/TLS?

To use a proxy, consult this SO question: Proxies in Python FTP application

You can also search in the Python documentation: ftplib module.

Community
  • 1
  • 1
Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103