projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
ddd8486
)
[downloader/rtmp] Generalize download messages and report time elapsed on finish
author
Sergey M․
<dstftw@gmail.com>
Sat, 26 May 2018 15:14:09 +0000
(22:14 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 26 May 2018 15:22:58 +0000
(22:22 +0700)
youtube_dl/downloader/rtmp.py
patch
|
blob
|
history
diff --git
a/youtube_dl/downloader/rtmp.py
b/youtube_dl/downloader/rtmp.py
index 63e2b5c8972d7143f45a1f2a7bd3f10db8d1ee2c..9e0ddbb18740c4217b66c3253b6f840faa79f6c4 100644
(file)
--- 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
RD_INCOMPLETE = 2
RD_NO_CONNECT = 3
+ started = time.time()
+
try:
retval = run_rtmpdump(args)
except KeyboardInterrupt:
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))
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:
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))
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',
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:
})
return True
else: