fix N.pointer exception for getUploaderName()
This commit is contained in:
parent
8baeb3dcae
commit
b9d0941411
|
@ -737,7 +737,8 @@ public class YoutubeStreamExtractor extends StreamExtractor {
|
|||
|
||||
@Override
|
||||
public String getUploaderName() throws ParsingException {
|
||||
return li.select("span.g-hovercard").first().text();
|
||||
return li.select("span[class*=\"attribution\"").first()
|
||||
.select("span").first().text();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,6 +53,6 @@ public class YoutubeServiceTest {
|
|||
|
||||
@Test
|
||||
public void testGetDefaultKiosk() throws Exception {
|
||||
assertEquals(kioskList.getDefaultKioskExtractor(null).getName(), "Trending");
|
||||
assertEquals(kioskList.getDefaultKioskExtractor(null).getId(), "Trending");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,6 +140,12 @@ public class YoutubeStreamExtractorDefaultTest {
|
|||
public void testGetRelatedVideos() throws ExtractionException, IOException {
|
||||
StreamInfoItemCollector relatedVideos = extractor.getRelatedVideos();
|
||||
assertFalse(relatedVideos.getItemList().isEmpty());
|
||||
if(!relatedVideos.getErrors().isEmpty()) {
|
||||
for(Throwable e : relatedVideos.getErrors()) {
|
||||
e.printStackTrace();
|
||||
System.err.println("----------------------");
|
||||
}
|
||||
}
|
||||
assertTrue(relatedVideos.getErrors().isEmpty());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,10 +36,10 @@ import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
|||
* <p>
|
||||
* WARNING: Deactivate this Test Case before uploading it to Github, otherwise CI will fail.
|
||||
*/
|
||||
@Ignore
|
||||
public class YoutubeStreamExtractorGemaTest {
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void testGemaError() throws IOException, ExtractionException {
|
||||
try {
|
||||
NewPipe.init(Downloader.getInstance());
|
||||
|
|
Loading…
Reference in New Issue