|
4 | 4 | import com.grack.nanojson.JsonObject; |
5 | 5 | import com.grack.nanojson.JsonParser; |
6 | 6 | import com.grack.nanojson.JsonParserException; |
7 | | -import org.jsoup.helper.StringUtil; |
| 7 | + |
8 | 8 | import org.schabi.newpipe.extractor.MediaFormat; |
9 | 9 | import org.schabi.newpipe.extractor.NewPipe; |
10 | 10 | import org.schabi.newpipe.extractor.StreamingService; |
|
17 | 17 | import org.schabi.newpipe.extractor.localization.DateWrapper; |
18 | 18 | import org.schabi.newpipe.extractor.services.peertube.PeertubeParsingHelper; |
19 | 19 | import org.schabi.newpipe.extractor.services.peertube.linkHandler.PeertubeSearchQueryHandlerFactory; |
20 | | -import org.schabi.newpipe.extractor.stream.*; |
| 20 | +import org.schabi.newpipe.extractor.stream.AudioStream; |
| 21 | +import org.schabi.newpipe.extractor.stream.Description; |
| 22 | +import org.schabi.newpipe.extractor.stream.Stream; |
| 23 | +import org.schabi.newpipe.extractor.stream.StreamExtractor; |
| 24 | +import org.schabi.newpipe.extractor.stream.StreamInfoItem; |
| 25 | +import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; |
| 26 | +import org.schabi.newpipe.extractor.stream.StreamType; |
| 27 | +import org.schabi.newpipe.extractor.stream.SubtitlesStream; |
| 28 | +import org.schabi.newpipe.extractor.stream.VideoStream; |
21 | 29 | import org.schabi.newpipe.extractor.utils.JsonUtils; |
| 30 | +import org.schabi.newpipe.extractor.utils.Utils; |
22 | 31 |
|
23 | | -import javax.annotation.Nonnull; |
24 | 32 | import java.io.IOException; |
25 | 33 | import java.io.UnsupportedEncodingException; |
26 | 34 | import java.net.URLEncoder; |
|
29 | 37 | import java.util.List; |
30 | 38 | import java.util.Locale; |
31 | 39 |
|
| 40 | +import javax.annotation.Nonnull; |
| 41 | + |
32 | 42 | public class PeertubeStreamExtractor extends StreamExtractor { |
33 | 43 |
|
34 | 44 |
|
@@ -255,7 +265,7 @@ public StreamInfoItemsCollector getRelatedStreams() throws IOException, Extracti |
255 | 265 | } else { |
256 | 266 | apiUrl = getUploaderUrl() + "/videos?start=0&count=8"; |
257 | 267 | } |
258 | | - if (!StringUtil.isBlank(apiUrl)) getStreamsFromApi(collector, apiUrl); |
| 268 | + if (!Utils.isBlank(apiUrl)) getStreamsFromApi(collector, apiUrl); |
259 | 269 | return collector; |
260 | 270 | } |
261 | 271 |
|
@@ -292,7 +302,7 @@ private String getRelatedStreamsUrl(List<String> tags) throws UnsupportedEncodin |
292 | 302 | private void getStreamsFromApi(StreamInfoItemsCollector collector, String apiUrl) throws ReCaptchaException, IOException, ParsingException { |
293 | 303 | Response response = getDownloader().get(apiUrl); |
294 | 304 | JsonObject relatedVideosJson = null; |
295 | | - if (null != response && !StringUtil.isBlank(response.responseBody())) { |
| 305 | + if (null != response && !Utils.isBlank(response.responseBody())) { |
296 | 306 | try { |
297 | 307 | relatedVideosJson = JsonParser.object().from(response.responseBody()); |
298 | 308 | } catch (JsonParserException e) { |
|
0 commit comments