aboutsummaryrefslogtreecommitdiffstats
path: root/youtube_dl/downloader/external.py
diff options
context:
space:
mode:
authorRogério Brito <rbrito@ime.usp.br>2017-05-19 03:21:46 -0300
committerRogério Brito <rbrito@ime.usp.br>2017-05-19 03:21:46 -0300
commit532a08904ffbacc5e5ccf99edb660c5f37ddb213 (patch)
tree12399229cfa94b847a3ba07fcdca2336e5adc5b0 /youtube_dl/downloader/external.py
parent97a8fc3ae80fb363c69c2e6b8c29b5373ac72aea (diff)
parentd9d7cd0e85dc712461d9185db9df9d6c900a573b (diff)
downloadyoutube-dl-532a08904ffbacc5e5ccf99edb660c5f37ddb213.zip
youtube-dl-532a08904ffbacc5e5ccf99edb660c5f37ddb213.tar.gz
youtube-dl-532a08904ffbacc5e5ccf99edb660c5f37ddb213.tar.bz2
Merge tag 'upstream/2017.05.18.1'
Upstream version 2017.05.18.1
Diffstat (limited to 'youtube_dl/downloader/external.py')
-rw-r--r--youtube_dl/downloader/external.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py
index e13cf54..e78169a 100644
--- a/youtube_dl/downloader/external.py
+++ b/youtube_dl/downloader/external.py
@@ -29,7 +29,17 @@ class ExternalFD(FileDownloader):
self.report_destination(filename)
tmpfilename = self.temp_name(filename)
- retval = self._call_downloader(tmpfilename, info_dict)
+ try:
+ retval = self._call_downloader(tmpfilename, info_dict)
+ except KeyboardInterrupt:
+ if not info_dict.get('is_live'):
+ raise
+ # Live stream downloading cancellation should be considered as
+ # correct and expected termination thus all postprocessing
+ # should take place
+ retval = 0
+ self.to_screen('[%s] Interrupted by user' % self.get_basename())
+
if retval == 0:
fsize = os.path.getsize(encodeFilename(tmpfilename))
self.to_screen('\r[%s] Downloaded %s bytes' % (self.get_basename(), fsize))