if os.path.exists(chunk_file) == False:
chunk_url = base_url + '/' + chunks_quality + '/' + chunk_name
- response = urllib2.urlopen(chunk_url)
- data = response.read()
+ try:
+ response = urllib2.urlopen(chunk_url)
+ data = response.read()
+
+ f = open(chunk_file, "wb")
+ f.write(data)
+ f.close()
+ except Exception as e:
+ print e
- f = open(chunk_file, "wb")
- f.write(data)
- f.close()
else:
f = open(chunk_file, "rb")
data = f.read()