From f1f0b34a4e2ab00caa37d48878d0858a330aa54e Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sun, 9 Oct 2016 10:38:00 -0400 Subject: [PATCH] Call _hook_progress() instead of faking it Since now report_progress() handles lack of a file size. --- youtube_dl/downloader/external.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/youtube_dl/downloader/external.py b/youtube_dl/downloader/external.py index fab137199..43bed3648 100644 --- a/youtube_dl/downloader/external.py +++ b/youtube_dl/downloader/external.py @@ -28,9 +28,7 @@ class ExternalFD(FileDownloader): retval = self._call_downloader(tmpfilename, info_dict) if retval == 0: if filename == '-': - # xxx report_progress() expects total_bytes to be set or it throws a KeyError, so - # we can't just call: self._hook_progress({'status': 'finished'}) - self.to_screen('[download] Download completed') + self._hook_progress({'status': 'finished'}) else: fsize = os.path.getsize(encodeFilename(tmpfilename)) self.to_screen('\r[%s] Downloaded %s bytes' % (self.get_basename(), fsize))