Enable sending consent cookie.

This commit is contained in:
Kavin 2023-12-17 04:50:47 +00:00
parent 79ff0404e8
commit bae104a03b
No known key found for this signature in database
GPG Key ID: 6E4598CA5C92C41F
3 changed files with 9 additions and 0 deletions

View File

@ -56,6 +56,10 @@ DISABLE_LBRY:false
# How long should unauthenticated subscriptions last for
SUBSCRIPTIONS_EXPIRY:30
# Send consent accepted cookie
# This is required for certain features to work in some countries
CONSENT_COOKIE:true
# Sentry DSN
# Use Sentry to log errors and trace performance
#SENTRY_DSN:INSERT_HERE

View File

@ -20,6 +20,7 @@ import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.localization.ContentCountry;
import org.schabi.newpipe.extractor.localization.Localization;
import org.schabi.newpipe.extractor.services.youtube.YoutubeJavaScriptPlayerManager;
import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper;
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor;
import org.schabi.newpipe.extractor.stream.StreamInfo;
import rocks.kavin.reqwest4j.ReqwestUtils;
@ -46,6 +47,7 @@ public class Main {
NewPipe.init(new DownloaderImpl(), new Localization("en", "US"), ContentCountry.DEFAULT, Multithreading.getCachedExecutor());
YoutubeStreamExtractor.forceFetchAndroidClient(true);
YoutubeStreamExtractor.forceFetchIosClient(true);
YoutubeParsingHelper.setConsentAccepted(CONSENT_COOKIE);
// Warm up the extractor
try {

View File

@ -83,6 +83,8 @@ public class Constants {
public static final int SUBSCRIPTIONS_EXPIRY;
public static final boolean CONSENT_COOKIE;
public static final String SENTRY_DSN;
public static final String S3_ENDPOINT;
@ -152,6 +154,7 @@ public class Constants {
DISABLE_SERVER = Boolean.parseBoolean(getProperty(prop, "DISABLE_SERVER", "false"));
DISABLE_LBRY = Boolean.parseBoolean(getProperty(prop, "DISABLE_LBRY", "false"));
SUBSCRIPTIONS_EXPIRY = Integer.parseInt(getProperty(prop, "SUBSCRIPTIONS_EXPIRY", "30"));
CONSENT_COOKIE = Boolean.parseBoolean(getProperty(prop, "CONSENT_COOKIE", "true"));
SENTRY_DSN = getProperty(prop, "SENTRY_DSN", "");
S3_ENDPOINT = getProperty(prop, "S3_ENDPOINT");
S3_ACCESS_KEY = getProperty(prop, "S3_ACCESS_KEY");