Skip to content

Commit bae104a

Browse files
committed
Enable sending consent cookie.
1 parent 79ff040 commit bae104a

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

config.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ DISABLE_LBRY:false
5656
# How long should unauthenticated subscriptions last for
5757
SUBSCRIPTIONS_EXPIRY:30
5858

59+
# Send consent accepted cookie
60+
# This is required for certain features to work in some countries
61+
CONSENT_COOKIE:true
62+
5963
# Sentry DSN
6064
# Use Sentry to log errors and trace performance
6165
#SENTRY_DSN:INSERT_HERE

src/main/java/me/kavin/piped/Main.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.schabi.newpipe.extractor.localization.ContentCountry;
2121
import org.schabi.newpipe.extractor.localization.Localization;
2222
import org.schabi.newpipe.extractor.services.youtube.YoutubeJavaScriptPlayerManager;
23+
import org.schabi.newpipe.extractor.services.youtube.YoutubeParsingHelper;
2324
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeStreamExtractor;
2425
import org.schabi.newpipe.extractor.stream.StreamInfo;
2526
import rocks.kavin.reqwest4j.ReqwestUtils;
@@ -46,6 +47,7 @@ public static void main(String[] args) throws Exception {
4647
NewPipe.init(new DownloaderImpl(), new Localization("en", "US"), ContentCountry.DEFAULT, Multithreading.getCachedExecutor());
4748
YoutubeStreamExtractor.forceFetchAndroidClient(true);
4849
YoutubeStreamExtractor.forceFetchIosClient(true);
50+
YoutubeParsingHelper.setConsentAccepted(CONSENT_COOKIE);
4951

5052
// Warm up the extractor
5153
try {

src/main/java/me/kavin/piped/consts/Constants.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ public class Constants {
8383

8484
public static final int SUBSCRIPTIONS_EXPIRY;
8585

86+
public static final boolean CONSENT_COOKIE;
87+
8688
public static final String SENTRY_DSN;
8789

8890
public static final String S3_ENDPOINT;
@@ -152,6 +154,7 @@ public class Constants {
152154
DISABLE_SERVER = Boolean.parseBoolean(getProperty(prop, "DISABLE_SERVER", "false"));
153155
DISABLE_LBRY = Boolean.parseBoolean(getProperty(prop, "DISABLE_LBRY", "false"));
154156
SUBSCRIPTIONS_EXPIRY = Integer.parseInt(getProperty(prop, "SUBSCRIPTIONS_EXPIRY", "30"));
157+
CONSENT_COOKIE = Boolean.parseBoolean(getProperty(prop, "CONSENT_COOKIE", "true"));
155158
SENTRY_DSN = getProperty(prop, "SENTRY_DSN", "");
156159
S3_ENDPOINT = getProperty(prop, "S3_ENDPOINT");
157160
S3_ACCESS_KEY = getProperty(prop, "S3_ACCESS_KEY");

0 commit comments

Comments
 (0)