From a8073896fcf47443081850f354f9988b668cba65 Mon Sep 17 00:00:00 2001 From: sum12 Date: Fri, 18 Nov 2016 12:49:43 +0530 Subject: [PATCH] [progess_hook] information for already downloaded files. added a new key 'alreadyexists' with value 'True' to dictionary passed to progress_hook. --- youtube_dl/downloader/common.py | 1 + youtube_dl/downloader/http.py | 1 + 2 files changed, 2 insertions(+) diff --git a/youtube_dl/downloader/common.py b/youtube_dl/downloader/common.py index 3dc144b4e..f04cff68b 100644 --- a/youtube_dl/downloader/common.py +++ b/youtube_dl/downloader/common.py @@ -338,6 +338,7 @@ class FileDownloader(object): self.report_file_already_downloaded(filename) self._hook_progress({ 'filename': filename, + 'alreadyexists':True, 'status': 'finished', 'total_bytes': os.path.getsize(encodeFilename(filename)), }) diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index af405b950..9f0588a9e 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -106,6 +106,7 @@ class HttpFD(FileDownloader): self.try_rename(tmpfilename, filename) self._hook_progress({ 'filename': filename, + 'alreadyexists':True, 'status': 'finished', 'downloaded_bytes': resume_len, 'total_bytes': resume_len,