]> asedeno.scripts.mit.edu Git - youtube-dl.git/blobdiff - youtube_dl/downloader/rtmp.py
[utils, etc] Kill child processes when yt-dl is killed
[youtube-dl.git] / youtube_dl / downloader / rtmp.py
index fbb7f51b018fabde5d140a033b953a35f9ca711e..8a25dbc8d5a841f3de1158f00298af291d658780 100644 (file)
@@ -89,11 +89,13 @@ class RtmpFD(FileDownloader):
                                 self.to_screen('')
                             cursor_in_new_line = True
                             self.to_screen('[rtmpdump] ' + line)
-            finally:
+                if not cursor_in_new_line:
+                    self.to_screen('')
+                return proc.wait()
+            except BaseException:  # Including KeyboardInterrupt
+                proc.kill()
                 proc.wait()
-            if not cursor_in_new_line:
-                self.to_screen('')
-            return proc.returncode
+                raise
 
         url = info_dict['url']
         player_url = info_dict.get('player_url')