aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-25 06:15:51 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-25 06:15:54 +0100
commitee69b99af6d00202a5ad8510604c807876d1b7b1 (patch)
treee3fb307290c38620646ae11a68075bb2a82a570a
parent767ff0a2d19a162edc5ea2d33e82ddb30ae244c8 (diff)
downloadyoutube-dl-ee69b99af6d00202a5ad8510604c807876d1b7b1.tar.xz
[YoutubeDL] clarify hook documentation
-rwxr-xr-xyoutube_dl/YoutubeDL.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 0241f7e3c..b772f87f1 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -198,11 +198,12 @@ class YoutubeDL(object):
postprocessor.
progress_hooks: A list of functions that get called on download
progress, with a dictionary with the entries
- * filename: The final filename
- * status: One of "downloading" and "finished"
-
- The dict may also have some of the following entries:
+ * status: One of "downloading" and "finished".
+ Check this first and ignore unknown values.
+ If status is one of "downloading" or "finished", the
+ following properties may also be present:
+ * filename: The final filename (always present)
* downloaded_bytes: Bytes on disk
* total_bytes: Size of the whole file, None if unknown
* tmpfilename: The filename we're currently writing to
@@ -1251,6 +1252,7 @@ class YoutubeDL(object):
if self.params.get('verbose'):
self.to_stdout('[debug] Invoking downloader on %r' % info.get('url'))
return fd.download(name, info)
+
if info_dict.get('requested_formats') is not None:
downloaded = []
success = True