Skip to content

Instantly share code, notes, and snippets.

@level09
Created August 8, 2012 18:22
Show Gist options
  • Save level09/3297276 to your computer and use it in GitHub Desktop.
Save level09/3297276 to your computer and use it in GitHub Desktop.
download from iNEWS
from ftplib import FTP
import ftplib
output = 'temp'
def download(block):
open(output,'w').write(block)
print ".",
ftp = FTP('10.10.25.41')
ftp.login('nialhariri','*****')
r = ftp.cwd('al-arabiya.news.bulletins.1300.runorder-ground')
print ftp.retrlines("LIST")
data = []
try:
data = ftp.nlst()
except ftplib.error_perm, resp:
pass
for file in data:
output = file
ftp.retrbinary('RETR '+file,download)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment