diff --git a/YoutubeConfig.json b/YoutubeConfig.json index fc09719ac558cc3e53dbe6059e17e545223d921a..fa3ac8471f2f2080816d6184af43eee83f7720d2 100644 --- a/YoutubeConfig.json +++ b/YoutubeConfig.json @@ -7,7 +7,7 @@ "sourceUrl": "https://plugins.grayjay.app/Youtube/YoutubeConfig.json", "repositoryUrl": "https://futo.org", "scriptUrl": "./YoutubeScript.js", - "version": 147, + "version": 148, "iconUrl": "./youtube.png", "id": "35ae969a-a7db-11ed-afa1-0242ac120002", diff --git a/YoutubeScript.js b/YoutubeScript.js index 7cc655756fdd940ec51a82e6da18ec6548bf3670..e8b944ac803e21f00d2ae8e8c9676e977d73535c 100644 --- a/YoutubeScript.js +++ b/YoutubeScript.js @@ -323,6 +323,7 @@ source.getContentDetails = (url, useAuth) => { const headersUsed = (useLogin) ? getAuthContextHeaders(false) : {}; headersUsed["Accept-Language"] = "en-US"; + headersUsed["Cookie"] = "PREF=hl=en&gl=US" const batch = http.batch().GET(url, headersUsed, useLogin); @@ -1747,10 +1748,11 @@ function requestPage(url, headers, useAuth = false) { else throw new ScriptException("Failed to request page [" + resp.code + "]"); } function requestInitialData(url, useMobile = false, useAuth = false) { - let headers = {"Accept-Language": "en-US" }; + let headers = {"Accept-Language": "en-US", "Cookie": "PREF=hl=en&gl=US" }; if(useMobile) headers["User-Agent"] = USER_AGENT_TABLET; + const resp = http.GET(url, headers, useAuth); throwIfCaptcha(resp); if(resp.isOk) {