From a83342de0ffb87e40a9bcd0dca5066903691f141 Mon Sep 17 00:00:00 2001 From: Ritvik Saraf <13ritvik@gmail.com> Date: Sat, 29 Dec 2018 21:58:43 +0530 Subject: [PATCH] update peertube instance --- .../extractor/services/peertube/PeertubeInstance.java | 2 +- .../extractor/services/peertube/PeertubeService.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeInstance.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeInstance.java index 2bedc07cf..967c387f0 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeInstance.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeInstance.java @@ -26,7 +26,7 @@ public class PeertubeInstance { setInstanceMetaData(response); } - private PeertubeInstance(String url , String name) { + public PeertubeInstance(String url , String name) { this.url = url; this.name = name; } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeService.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeService.java index efd86c758..2fc571ef3 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeService.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/peertube/PeertubeService.java @@ -140,6 +140,15 @@ public class PeertubeService extends StreamingService { this.getServiceInfo().setName("PeerTube"); } } + + public void setInstance(String url, String name) throws IOException { + this.instance = new PeertubeInstance(url, name); + if(!StringUtil.isBlank(instance.getName())) { + this.getServiceInfo().setName(instance.getName()); + }else { + this.getServiceInfo().setName("PeerTube"); + } + } @Override public KioskList getKioskList() throws ExtractionException {