aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-05-26 22:14:09 +0700
committerSergey M․ <dstftw@gmail.com>2018-05-26 22:22:58 +0700
commitf16f48779cbad4a6d39a908e131a8d55941d1671 (patch)
tree05114d9bedfb538c4f5d8f2e004e43c5744057f2 /youtube_dl/downloader
parentddd8486a448ee94134a62f2488e5e39bbd72880e (diff)
[downloader/rtmp] Generalize download messages and report time elapsed on finish
Diffstat (limited to 'youtube_dl/downloader')
-rw-r--r--youtube_dl/downloader/rtmp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dl/downloader/rtmp.py
index 63e2b5c89..9e0ddbb18 100644
--- a/youtube_dl/downloader/rtmp.py
+++ b/youtube_dl/downloader/rtmp.py
@@ -170,6 +170,8 @@ class RtmpFD(FileDownloader):
RD_INCOMPLETE = 2
RD_NO_CONNECT = 3
+ started = time.time()
+
try:
retval = run_rtmpdump(args)
except KeyboardInterrupt:
@@ -184,7 +186,7 @@ class RtmpFD(FileDownloader):
while retval in (RD_INCOMPLETE, RD_FAILED) and not test and not live:
prevsize = os.path.getsize(encodeFilename(tmpfilename))
- self.to_screen('[rtmpdump] %s bytes' % prevsize)
+ self.to_screen('[rtmpdump] Downloaded %s bytes' % prevsize)
time.sleep(5.0) # This seems to be needed
args = basic_args + ['--resume']
if retval == RD_FAILED:
@@ -201,13 +203,14 @@ class RtmpFD(FileDownloader):
break
if retval == RD_SUCCESS or (test and retval == RD_INCOMPLETE):
fsize = os.path.getsize(encodeFilename(tmpfilename))
- self.to_screen('[rtmpdump] %s bytes' % fsize)
+ self.to_screen('[rtmpdump] Downloaded %s bytes' % fsize)
self.try_rename(tmpfilename, filename)
self._hook_progress({
'downloaded_bytes': fsize,
'total_bytes': fsize,
'filename': filename,
'status': 'finished',
+ 'elapsed': time.time() - started,
})
return True
else: