Ignore subscriptions with invalid url and keep ones with empty title.
if a channel if deleted (thus it has an empty title), it is imported in NewPipe anyway, so that if it becomes undeleted in the future, it will be shown in the app.
This commit is contained in:
parent
d5043cdf49
commit
171f2c49fe
|
@ -63,20 +63,10 @@ public class YoutubeSubscriptionExtractor extends SubscriptionExtractor {
|
||||||
String title = outline.attr("title");
|
String title = outline.attr("title");
|
||||||
String xmlUrl = outline.attr("abs:xmlUrl");
|
String xmlUrl = outline.attr("abs:xmlUrl");
|
||||||
|
|
||||||
if (title.isEmpty()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (xmlUrl.isEmpty()) {
|
|
||||||
throw new InvalidSourceException("document has invalid entries");
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String id = Parser.matchGroup1(ID_PATTERN, xmlUrl);
|
String id = Parser.matchGroup1(ID_PATTERN, xmlUrl);
|
||||||
result.add(new SubscriptionItem(service.getServiceId(), BASE_CHANNEL_URL + id, title));
|
result.add(new SubscriptionItem(service.getServiceId(), BASE_CHANNEL_URL + id, title));
|
||||||
} catch (Parser.RegexException e) {
|
} catch (Parser.RegexException ignored) { /* ignore invalid subscriptions */ }
|
||||||
throw new InvalidSourceException("document has invalid entries", e);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue