Skip to content

Commit f1fa84b

Browse files
committed
[YouTube] Don't throw an exception when there is no banner available on a channel
Channels may not have a banner, so no exception should be thrown if no banner is found.
1 parent 39a911d commit f1fa84b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelExtractor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,10 @@ public String getBannerUrl() throws ParsingException {
282282
))
283283
.filter(url -> !url.contains("s.ytimg.com") && !url.contains("default_banner"))
284284
.map(YoutubeParsingHelper::fixThumbnailUrl)
285-
.orElseThrow(() -> new ParsingException("Could not get banner"));
285+
// Channels may not have a banner, so no exception should be thrown if no banner is
286+
// found
287+
// Return null in this case
288+
.orElse(null);
286289
}
287290

288291
@Override

0 commit comments

Comments
 (0)