From 52d6a9a61dbb4fc6e642e340255cf2230ccbee23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Wed, 5 Mar 2014 22:19:27 +0700 Subject: [PATCH] Handle rtmpdump's no connection return value --- youtube_dl/downloader/rtmp.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dl/downloader/rtmp.py index 67461f1607..034875ab7f 100644 --- a/youtube_dl/downloader/rtmp.py +++ b/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)