fix exception on found ads
This commit is contained in:
parent
647605c5a6
commit
d6a00228e8
|
@ -1,5 +1,6 @@
|
|||
package org.schabi.newpipe.extractor;
|
||||
|
||||
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -84,6 +85,8 @@ public abstract class InfoItemCollector<I extends InfoItem, E> implements Collec
|
|||
public void commit(E extractor) {
|
||||
try {
|
||||
addItem(extract(extractor));
|
||||
} catch (FoundAdException ae) {
|
||||
// found an ad. Maybe a debug line could be placed here
|
||||
} catch (ParsingException e) {
|
||||
addError(e);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class YoutubeSearchEngineStreamTest {
|
|||
|
||||
// Youtube will suggest "results" instead of "rsults",
|
||||
// keep in mind that the suggestions can change by country (the parameter "de")
|
||||
result = engine.search("rsults", 0, "de", SearchEngine.Filter.STREAM)
|
||||
result = engine.search("abc", 0, "de", SearchEngine.Filter.STREAM)
|
||||
.getSearchResult();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue