agelimit now returns 18 if the video is marked as nsfw, 0 otherwise
+ created getBoolean method in JsonUtils.java
This commit is contained in:
@@ -139,4 +139,12 @@ public class PeertubeStreamExtractorDefaultTest {
|
||||
public void testGetSubtitlesList() throws IOException, ExtractionException {
|
||||
assertFalse(extractor.getSubtitlesDefault().isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetAgeLimit() throws ExtractionException, IOException {
|
||||
assertEquals(0, extractor.getAgeLimit());
|
||||
PeertubeStreamExtractor ageLimit = (PeertubeStreamExtractor) PeerTube.getStreamExtractor("https://peertube.co.uk/videos/watch/6762bb04-cad5-407b-81ee-c18eac4715a7");
|
||||
ageLimit.fetchPage();
|
||||
assertEquals(18, ageLimit.getAgeLimit());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user