1
0
Fork 0
mirror of https://gitlab.com/dstftw/youtube-dl.git synced 2020-11-16 09:42:26 +00:00

Handle rtmpdump's no connection return value

This commit is contained in:
Sergey M․ 2014-03-05 22:19:27 +07:00
parent ad242b5fbc
commit 52d6a9a61d

View file

@ -155,9 +155,14 @@ class RtmpFD(FileDownloader):
RD_SUCCESS = 0 RD_SUCCESS = 0
RD_FAILED = 1 RD_FAILED = 1
RD_INCOMPLETE = 2 RD_INCOMPLETE = 2
RD_NO_CONNECT = 3
retval = run_rtmpdump(args) retval = run_rtmpdump(args)
if retval == RD_NO_CONNECT:
self.to_screen(u'[rtmpdump] Could not connect to RTMP server.')
return False
while (retval == RD_INCOMPLETE or retval == RD_FAILED) and not test: while (retval == RD_INCOMPLETE or retval == RD_FAILED) and not test:
prevsize = os.path.getsize(encodeFilename(tmpfilename)) prevsize = os.path.getsize(encodeFilename(tmpfilename))
self.to_screen(u'[rtmpdump] %s bytes' % prevsize) self.to_screen(u'[rtmpdump] %s bytes' % prevsize)