From d44d79d1b25cb9db4b92d94b40e282fd366b21af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Marqui=CC=81nez=20Ferra=CC=81ndiz?= Date: Wed, 22 Jan 2014 20:29:08 +0100 Subject: [PATCH] =?UTF-8?q?[downloader]=20Set=20the=20progress=20hook?= =?UTF-8?q?=E2=80=99s=20status=20to=20=E2=80=98already=5Fdownloaded?= =?UTF-8?q?=E2=80=99=20if=20the=20file=20has=20already=20been=20downloaded?= =?UTF-8?q?=20(closes=20#2144)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- youtube_dl/downloader/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py index 10143d56a..b2e9d3613 100644 --- a/youtube_dl/downloader/common.py +++ b/youtube_dl/downloader/common.py @@ -282,7 +282,7 @@ class FileDownloader(object): self.report_file_already_downloaded(filename) self._hook_progress({ 'filename': filename, - 'status': 'finished', + 'status': 'already_downloaded', 'total_bytes': os.path.getsize(encodeFilename(filename)), }) return True @@ -300,7 +300,7 @@ class FileDownloader(object): def add_progress_hook(self, ph): """ ph gets called on download progress, with a dictionary with the entries * filename: The final filename - * status: One of "downloading" and "finished" + * status: One of "downloading", "finished" or "already_downloaded" It can also have some of the following entries: