1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-22 16:57:40 +00:00

Do not resume live streams

No resuming or seeking in live streams is possible (c) man rtmpdump
This commit is contained in:
Sergey M․ 2014-03-05 22:46:20 +07:00
parent 8dec03ecba
commit 9d6105c9f0

View file

@ -129,7 +129,7 @@ class RtmpFD(FileDownloader):
basic_args += ['--live'] basic_args += ['--live']
if conn: if conn:
basic_args += ['--conn', conn] basic_args += ['--conn', conn]
args = basic_args + [[], ['--resume', '--skip', '1']][self.params.get('continuedl', False)] args = basic_args + [[], ['--resume', '--skip', '1']][not live and self.params.get('continuedl', False)]
if sys.platform == 'win32' and sys.version_info < (3, 0): if sys.platform == 'win32' and sys.version_info < (3, 0):
# Windows subprocess module does not actually support Unicode # Windows subprocess module does not actually support Unicode
@ -165,7 +165,7 @@ class RtmpFD(FileDownloader):
self.report_error('[rtmpdump] Could not connect to RTMP server.') self.report_error('[rtmpdump] Could not connect to RTMP server.')
return False return False
while (retval == RD_INCOMPLETE or retval == RD_FAILED) and not test: while (retval == RD_INCOMPLETE or retval == RD_FAILED) and not test and not live:
prevsize = os.path.getsize(encodeFilename(tmpfilename)) prevsize = os.path.getsize(encodeFilename(tmpfilename))
self.to_screen('[rtmpdump] %s bytes' % prevsize) self.to_screen('[rtmpdump] %s bytes' % prevsize)
time.sleep(5.0) # This seems to be needed time.sleep(5.0) # This seems to be needed