projects
/
smooth-dl.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6495644
)
Print more details when downloading a chunk fails
author
Antonio Ospite <ao2@ao2.it>
Tue, 4 Mar 2014 11:24:32 +0000
(12:24 +0100)
committer
Antonio Ospite <ao2@ao2.it>
Tue, 4 Mar 2014 11:24:32 +0000
(12:24 +0100)
smooth-dl.py
patch
|
blob
|
history
diff --git
a/smooth-dl.py
b/smooth-dl.py
index
91b4ec2
..
29115b3
100755
(executable)
--- a/
smooth-dl.py
+++ b/
smooth-dl.py
@@
-215,12
+215,16
@@
def download_chunks(base_url, manifest, stream_index, quality_level, dest_dir):
if os.path.exists(chunk_file) == False:
chunk_url = base_url + '/' + chunks_quality + '/' + chunk_name
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()
else:
f = open(chunk_file, "rb")
data = f.read()