From c0c78ae9bb6636c45cca8444a388a71bc20c59ff Mon Sep 17 00:00:00 2001 From: TobiGr Date: Sun, 4 Apr 2021 12:26:55 +0200 Subject: [PATCH] Do not set reChaptache cookie when there is no cookie stored In DownloaderImpl#getCookies(String url) the reChaptcha cookie is set if it is not null. For this reason, the cookie was set in every request. --- app/src/main/java/org/schabi/newpipe/App.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/schabi/newpipe/App.java b/app/src/main/java/org/schabi/newpipe/App.java index e3e9c3e4e..af118387c 100644 --- a/app/src/main/java/org/schabi/newpipe/App.java +++ b/app/src/main/java/org/schabi/newpipe/App.java @@ -130,7 +130,7 @@ public class App extends MultiDexApplication { final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences( getApplicationContext()); final String key = getApplicationContext().getString(R.string.recaptcha_cookies_key); - downloader.setCookie(ReCaptchaActivity.RECAPTCHA_COOKIES_KEY, prefs.getString(key, "")); + downloader.setCookie(ReCaptchaActivity.RECAPTCHA_COOKIES_KEY, prefs.getString(key, null)); downloader.updateYoutubeRestrictedModeCookies(getApplicationContext()); }