Skip to content

Commit 0b940f5

Browse files
committed
Use "getAgeLimit() != NO_AGE_LIMIT" instead of "getAgeLimit() == 18"
1 parent beb07a4 commit 0b940f5

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ public StreamType getStreamType() throws ParsingException {
504504
@Override
505505
public StreamInfoItem getNextStream() throws ExtractionException {
506506
assertPageFetched();
507-
if (getAgeLimit() == 18) {
508-
return null;
509-
}
507+
508+
if (getAgeLimit() != NO_AGE_LIMIT) return null;
509+
510510
try {
511511
final JsonObject videoInfo = initialData.getObject("contents").getObject("twoColumnWatchNextResults")
512512
.getObject("secondaryResults").getObject("secondaryResults").getArray("results")
@@ -525,9 +525,9 @@ public StreamInfoItem getNextStream() throws ExtractionException {
525525
@Override
526526
public StreamInfoItemsCollector getRelatedStreams() throws ExtractionException {
527527
assertPageFetched();
528-
if (getAgeLimit() == 18) {
529-
return null;
530-
}
528+
529+
if (getAgeLimit() != NO_AGE_LIMIT) return null;
530+
531531
try {
532532
StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
533533
JsonArray results = initialData.getObject("contents").getObject("twoColumnWatchNextResults")
@@ -773,7 +773,7 @@ private String getDecryptionFuncName(String playerCode) throws DecryptException
773773
@Nonnull
774774
private List<SubtitlesInfo> getAvailableSubtitlesInfo() {
775775
// If the video is age restricted getPlayerConfig will fail
776-
if (getAgeLimit() == 18) return Collections.emptyList();
776+
if (getAgeLimit() != NO_AGE_LIMIT) return Collections.emptyList();
777777

778778
final JsonObject captions;
779779
if (!playerResponse.has("captions")) {

0 commit comments

Comments
 (0)