mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
fix
This commit is contained in:
parent
33bacc192b
commit
1bab6aa3a3
2 changed files with 2 additions and 2 deletions
|
@ -80,7 +80,7 @@ def _create_temp_js(self, jscode):
|
||||||
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):
|
||||||
"""Execute JS directly in Deno environment and return stdout"""
|
"""Execute JS directly in Deno environment and return stdout"""
|
||||||
|
|
||||||
base_js = 'delete window.Deno; global = window'
|
base_js = 'delete window.Deno; global = window;'
|
||||||
|
|
||||||
with self._create_temp_js(base_js + jscode) as js_file:
|
with self._create_temp_js(base_js + jscode) as js_file:
|
||||||
self.extractor.to_screen(f'{format_field(video_id, None, "%s: ")}{note}')
|
self.extractor.to_screen(f'{format_field(video_id, None, "%s: ")}{note}')
|
||||||
|
|
|
@ -114,7 +114,7 @@ def _calc_butter_token(self):
|
||||||
|
|
||||||
butter_js += '''const navProxy = new Proxy(window.navigator, { get: (target, prop, receiver) => {
|
butter_js += '''const navProxy = new Proxy(window.navigator, { get: (target, prop, receiver) => {
|
||||||
if (prop === 'webdriver') return false;
|
if (prop === 'webdriver') return false;
|
||||||
return target[prop];});
|
return target[prop];}});
|
||||||
Object.defineProperty(window, "navigator", {get: () => navProxy});
|
Object.defineProperty(window, "navigator", {get: () => navProxy});
|
||||||
window.location = {origin: "https://rplay.live"};'''
|
window.location = {origin: "https://rplay.live"};'''
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue