1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-07-10 15:28:33 +00:00
This commit is contained in:
c-basalt 2024-08-02 17:21:48 -04:00
parent 1bab6aa3a3
commit 532c6b2eb5

View File

@ -77,7 +77,7 @@ def _create_temp_js(self, jscode):
with contextlib.suppress(OSError):
os.remove(js_file.name)
def deno_execute(self, jscode, video_id=None, *, note='Executing JS in Deno', allow_net=None):
def deno_execute(self, jscode, video_id=None, *, note='Executing JS in Deno', allow_net=None, jit_less=True):
"""Execute JS directly in Deno environment and return stdout"""
base_js = 'delete window.Deno; global = window;'
@ -88,6 +88,8 @@ def deno_execute(self, jscode, video_id=None, *, note='Executing JS in Deno', al
cmd = [self.exe, 'run', js_file.name]
if allow_net:
cmd.append('--allow-net' if isinstance(allow_net, bool) else f'--allow-net={allow_net}')
if jit_less:
cmd.append('--v8-flags=--jitless')
self.extractor.write_debug(f'Deno command line: {shell_quote(cmd)}')
try: