Created
August 8, 2012 18:22
-
-
Save level09/3297276 to your computer and use it in GitHub Desktop.
download from iNEWS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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