aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/downloader/rtmp.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan@gmail.com>2021-01-09 17:56:12 +0530
committerdirkf <fieldhouse@gmx.net>2022-06-10 19:57:46 +0100
commit0700fde6403aa9eec1ff02bff7323696a205900c (patch)
treef1ed405d2af1934a06ff2091420172a0cc98f23a /youtube_dl/downloader/rtmp.py
parent811c480f7b6c25ca510a033e6365d00174135392 (diff)
downloadyoutube-dl-0700fde6403aa9eec1ff02bff7323696a205900c.tar.xz
[utils, etc] Kill child processes when yt-dl is killed
* derived from PR #26592, closes #26592 Authored by: Unrud
Diffstat (limited to 'youtube_dl/downloader/rtmp.py')
-rw-r--r--youtube_dl/downloader/rtmp.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/downloader/rtmp.py b/youtube_dl/downloader/rtmp.py
index fbb7f51b0..8a25dbc8d 100644
--- a/youtube_dl/downloader/rtmp.py
+++ b/youtube_dl/downloader/rtmp.py
@@ -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')