from urllib.request import urlretrieve
def cbk (a,b,c) :
'''
report function
a:the number of data block
b:the size of data block
c:the total size of data
'''
per=100.0 *a*b/c
if (per>100 ):
per=100
print ('%.2f%%' % per)
url='http://202.119.4.150/photo/2016/'
local='/home/he/Desktop/photo/'
base=161463
for i in range(100 ):
number=base+i
url1=url+str(number)+'.jpg'
local1=local+str(number)+'.jpg'
urlretrieve(url1,local1,cbk)
0.00%
88.02%
100.00%
0.00%
89.76%
100.00%
0.00%
84.83%
100.00%
0.00%
82.87%
100.00%
0.00%
84.18%
100.00%
0.00%
84.54%
100.00%
0.00%
85.11%
100.00%
0.00%
83.52%
100.00%
0.00%
87.01%
100.00%
0.00%
80.20%
100.00%
0.00%
86.19%
100.00%
0.00%
82.96%
100.00%
0.00%
86.96%
100.00%
0.00%
87.41%
100.00%
0.00%
100.00%
0.00%
91.67%
100.00%
0.00%
100.00%
0.00%
96.11%
100.00%
0.00%
98.49%
100.00%
0.00%
100.00%
0.00%
95.95%
100.00%
0.00%
91.91%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
97.61%
100.00%
0.00%
94.80%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
91.64%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
83.16%
100.00%
0.00%
97.94%
100.00%
0.00%
86.69%
100.00%
0.00%
83.86%
100.00%
0.00%
86.01%
100.00%
0.00%
83.50%
100.00%
0.00%
81.77%
100.00%
0.00%
83.89%
100.00%
0.00%
85.37%
100.00%
0.00%
86.55%
100.00%
0.00%
87.20%
100.00%
0.00%
83.04%
100.00%
0.00%
88.23%
100.00%
0.00%
85.39%
100.00%
0.00%
84.65%
100.00%
0.00%
84.19%
100.00%
0.00%
83.34%
100.00%
0.00%
83.14%
100.00%
0.00%
83.46%
100.00%
0.00%
88.65%
100.00%
0.00%
84.55%
100.00%
0.00%
83.24%
100.00%
0.00%
83.20%
100.00%
0.00%
86.20%
100.00%
0.00%
86.59%
100.00%
0.00%
85.86%
100.00%
0.00%
85.46%
100.00%
0.00%
80.73%
100.00%
0.00%
84.93%
100.00%
0.00%
85.57%
100.00%
0.00%
82.46%
100.00%
0.00%
81.62%
100.00%
0.00%
81.63%
100.00%
0.00%
87.31%
100.00%
0.00%
82.85%
100.00%
0.00%
83.57%
100.00%
0.00%
86.05%
100.00%
0.00%
88.54%
100.00%
0.00%
82.91%
100.00%
0.00%
86.50%
100.00%
0.00%
83.30%
100.00%
0.00%
84.28%
100.00%
0.00%
83.81%
100.00%
0.00%
87.87%
100.00%
0.00%
77.97%
100.00%
0.00%
97.11%
100.00%
0.00%
91.12%
100.00%
0.00%
94.68%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
96.23%
100.00%
0.00%
100.00%
0.00%
100.00%
0.00%
78.60%
100.00%
0.00%
76.61%
100.00%
0.00%
63.49%
100.00%
0.00%
100.00%
0.00%
76.63%
100.00%
0.00%
75.89%
100.00%
0.00%
100.00%