Skip to content

Commit 6ba03e5

Browse files
committed
Cache getVideoTab()
1 parent 8bfbae9 commit 6ba03e5

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
5353
/*package-private*/ static final String CHANNEL_URL_BASE = "https://www.youtube.com/channel/";
5454

5555
private JsonObject initialData;
56+
private JsonObject videoTab;
5657

5758
public YoutubeChannelExtractor(StreamingService service, ListLinkHandler linkHandler) {
5859
super(service, linkHandler);
@@ -276,6 +277,8 @@ public String getUploaderUrl() {
276277
}
277278

278279
private JsonObject getVideoTab() throws ParsingException {
280+
if (this.videoTab != null) return this.videoTab;
281+
279282
JsonArray tabs = initialData.getObject("contents").getObject("twoColumnBrowseResultsRenderer")
280283
.getArray("tabs");
281284
JsonObject videoTab = null;
@@ -301,6 +304,7 @@ private JsonObject getVideoTab() throws ParsingException {
301304
return null;
302305
} catch (Exception ignored) {}
303306

307+
this.videoTab = videoTab;
304308
return videoTab;
305309
}
306310
}

0 commit comments

Comments
 (0)