]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/utils.py
[jsinterp] Implement timeout
[yt-dlp.git] / yt_dlp / utils.py
index 49ee2286504ee69140b00bb50246e05e686c7098..13768d84690ab35a52e6cbc8a9be4f0ab105a2e7 100644 (file)
@@ -860,9 +860,9 @@ def kill(self, *, timeout=0):
             self.wait(timeout=timeout)
 
     @classmethod
-    def run(cls, *args, **kwargs):
+    def run(cls, *args, timeout=None, **kwargs):
         with cls(*args, **kwargs) as proc:
-            stdout, stderr = proc.communicate_or_kill()
+            stdout, stderr = proc.communicate_or_kill(timeout=timeout)
             return stdout or '', stderr or '', proc.returncode