Handle rtmpdump's no connection return value
authorSergey M․ <dstftw@gmail.com>
Wed, 5 Mar 2014 15:19:27 +0000 (22:19 +0700)
committerSergey M․ <dstftw@gmail.com>
Wed, 5 Mar 2014 15:19:27 +0000 (22:19 +0700)
youtube_dl/downloader/rtmp.py

index 67461f160707d1a5e56643181b973728a354bf16..034875ab7f12619a72579c52ee58af4377d259a7 100644 (file)
@@ -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)