Anonymous ID: ac076f April 6, 2018, 4:02 p.m. No.926291   ๐Ÿ—„๏ธ.is ๐Ÿ”—kun   >>6296 >>6307

#!/usr/bin/python

 

import sys

import ftplib

import os

import time

 

server = "FTPHOST"

user = "anonymous"

password = "anonymous"

source = "midland.agency/content/"

destination = "/home/user/downloads/"

interval = 0.05

 

ftp = ftplib.FTP(server)

ftp.login(user, password)

 

def downloadFiles(path, destination):

try:

ftp.cwd(path)

os.chdir(destination)

mkdir_p(destination[0:len(destination)-1] + path)

print "Created: " + destination[0:len(destination)-1] + path

except OSError:

pass

except ftplib.error_perm:

print "Error: could not change to " + path

sys.exit("Ending Application")

 

filelist=ftp.nlst()

 

for file in filelist:

time.sleep(interval)

try:

ftp.cwd(path + file + "/")

downloadFiles(path + file + "/", destination)

except ftplib.error_perm:

os.chdir(destination[0:len(destination)-1] + path)

 

try:

ftp.retrbinary("RETR " + file, open(os.path.join(destination + path, file),"wb").write)

print "Downloaded: " + file

except:

print "Error: File could not be downloaded " + file

return

 

def mkdir_p(path):

try:

os.makedirs(path)

except OSError as exc:

if exc.errno == errno.EEXIST and os.path.isdir(path):

pass

else:

raise

 

downloadFiles(source, destination)

 

 

 

Try this, it should download all files and foldes

Anonymous ID: ac076f April 6, 2018, 4:14 p.m. No.926484   ๐Ÿ—„๏ธ.is ๐Ÿ”—kun   >>6498

>>926460

exifdata

 

Summary

Detailed

 

Upload

 

 

Summary

 

33dcdd93919599eb3d604bc3f7d3cad2e528b84affbb8d1edbee1911d545e27b.jpg

(click for original)

 

Resolution

320x424

 

File Size

9.4 kB

File Type

JPEG

MIME Type

image/jpeg

Image Width

320

Image Height

424

Encoding Process

Progressive DCT, Huffman coding

Bits Per Sample

8

Color Components

3

X Resolution

72

Y Resolution

72

YCbCr Sub Sampling

YCbCr4:2:0 (2 2)

 

 

 

 

 

Detailed

 

System

File Name

33dcdd93919599eb3d604bc3f7d3cad2e528b84affbb8d1edbee1911d545e27b.jpg

File Size

9.4 kB

File Modify Date

2018:04:06 19:13:42-04:00

File Permissions

rw-rโ€“rโ€“

 

File

File Type

JPEG

MIME Type

image/jpeg

Image Width

320

Image Height

424

Encoding Process

Progressive DCT, Huffman coding

Bits Per Sample

8

Color Components

3

Y Cb Cr Sub Sampling

YCbCr4:2:0 (2 2)

 

JFIF

JFIF Version

1.01

Resolution Unit

inches

X Resolution

72

Y Resolution

72

 

Composite

Image Size

320x424

First pic

Anonymous ID: ac076f April 6, 2018, 4:14 p.m. No.926498   ๐Ÿ—„๏ธ.is ๐Ÿ”—kun

>>926484

System

File Name

d28614c1e6991e7d247bcc33948c508e41378197798ffafb604d20386c68ad4f.jpg

File Size

11 kB

File Modify Date

2018:04:06 19:14:24-04:00

File Permissions

rw-rโ€“rโ€“

 

File

File Type

JPEG

MIME Type

image/jpeg

Image Width

646

Image Height

432

Encoding Process

Progressive DCT, Huffman coding

Bits Per Sample

8

Color Components

3

Y Cb Cr Sub Sampling

YCbCr4:2:0 (2 2)

 

JFIF

JFIF Version

1.01

Resolution Unit

inches

X Resolution

72

Y Resolution

72

 

Composite

Image Size

646x432