Browse Source

Handle rtmpdump's no connection return value

master
Sergey M․ 10 years ago
parent
commit
52d6a9a61d
1 changed files with 5 additions and 0 deletions
  1. 5
      youtube_dl/downloader/rtmp.py

5
youtube_dl/downloader/rtmp.py

@ -155,9 +155,14 @@ class RtmpFD(FileDownloader):
RD_SUCCESS = 0
RD_FAILED = 1
RD_INCOMPLETE = 2
RD_NO_CONNECT = 3
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:
prevsize = os.path.getsize(encodeFilename(tmpfilename))
self.to_screen(u'[rtmpdump] %s bytes' % prevsize)

Loading…
Cancel
Save