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:
Stypox 2019-04-28 14:17:52 +02:00
parent d5043cdf49
commit 171f2c49fe
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 1 additions and 11 deletions

View File

@ -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;