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:
parent
65697b3bf3
commit
d44d79d1b2
@ -282,7 +282,7 @@ class FileDownloader(object):
|
|||||||
self.report_file_already_downloaded(filename)
|
self.report_file_already_downloaded(filename)
|
||||||
self._hook_progress({
|
self._hook_progress({
|
||||||
'filename': filename,
|
'filename': filename,
|
||||||
'status': 'finished',
|
'status': 'already_downloaded',
|
||||||
'total_bytes': os.path.getsize(encodeFilename(filename)),
|
'total_bytes': os.path.getsize(encodeFilename(filename)),
|
||||||
})
|
})
|
||||||
return True
|
return True
|
||||||
@ -300,7 +300,7 @@ class FileDownloader(object):
|
|||||||
def add_progress_hook(self, ph):
|
def add_progress_hook(self, ph):
|
||||||
""" ph gets called on download progress, with a dictionary with the entries
|
""" ph gets called on download progress, with a dictionary with the entries
|
||||||
* filename: The final filename
|
* 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:
|
It can also have some of the following entries:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user