agelimit now returns 18 if the video is marked as nsfw, 0 otherwise

+ created getBoolean method in JsonUtils.java
This commit is contained in:
B0pol
2020-01-23 04:42:54 +01:00
parent bcfe7be4e6
commit 1a15c0e750
3 changed files with 24 additions and 2 deletions

View File

@@ -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());
}
}