1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

[downloader] Set the progress hook’s status to ‘already_downloaded’ if the file has already been downloaded (closes #2144)

This commit is contained in:
Jaime Marquínez Ferrándiz 2014-01-22 20:29:08 +01:00
parent 65697b3bf3
commit d44d79d1b2

View File

@ -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: