diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java index 0eaf1d9d..c545ea80 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/extractors/SoundcloudStreamExtractor.java @@ -68,8 +68,10 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Nonnull @Override - public String getTextualUploadDate() throws ParsingException { - return track.getString("created_at").replace("T"," ").replace("Z", ""); + public String getTextualUploadDate() { + return track.getString("created_at") + .replace("T"," ") + .replace("Z", ""); } @Nonnull @@ -85,10 +87,10 @@ public class SoundcloudStreamExtractor extends StreamExtractor { if (artworkUrl.isEmpty()) { artworkUrl = track.getObject("user").getString("avatar_url", EMPTY_STRING); } - String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); - return artworkUrlBetterResolution; + return artworkUrl.replace("large.jpg", "crop.jpg"); } + @Nonnull @Override public Description getDescription() { return new Description(track.getString("description"), Description.PLAIN_TEXT); @@ -144,19 +146,19 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Nonnull @Override - public String getSubChannelUrl() throws ParsingException { + public String getSubChannelUrl() { return ""; } @Nonnull @Override - public String getSubChannelName() throws ParsingException { + public String getSubChannelName() { return ""; } @Nonnull @Override - public String getSubChannelAvatarUrl() throws ParsingException { + public String getSubChannelAvatarUrl() { return ""; } @@ -168,14 +170,14 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Nonnull @Override - public String getHlsUrl() throws ParsingException { + public String getHlsUrl() { return ""; } @Override public List getAudioStreams() throws IOException, ExtractionException { List audioStreams = new ArrayList<>(); - Downloader dl = NewPipe.getDownloader(); + final Downloader dl = NewPipe.getDownloader(); // Streams can be streamable and downloadable - or explicitly not. // For playing the track, it is only necessary to have a streamable track. @@ -183,12 +185,12 @@ public class SoundcloudStreamExtractor extends StreamExtractor { if (!track.getBoolean("streamable")) return audioStreams; try { - JsonArray transcodings = track.getObject("media").getArray("transcodings"); + final JsonArray transcodings = track.getObject("media").getArray("transcodings"); // get information about what stream formats are available for (Object transcoding : transcodings) { - JsonObject t = (JsonObject) transcoding; + final JsonObject t = (JsonObject) transcoding; String url = t.getString("url"); if (!isNullOrEmpty(url)) { @@ -200,7 +202,7 @@ public class SoundcloudStreamExtractor extends StreamExtractor { // This url points to the endpoint which generates a unique and short living url to the stream. // TODO: move this to a separate method to generate valid urls when needed (e.g. resuming a paused stream) url += "?client_id=" + SoundcloudParsingHelper.clientId(); - String res = dl.get(url).responseBody(); + final String res = dl.get(url).responseBody(); try { JsonObject mp3UrlObject = JsonParser.object().from(res); @@ -234,24 +236,24 @@ public class SoundcloudStreamExtractor extends StreamExtractor { } @Override - public List getVideoStreams() throws IOException, ExtractionException { + public List getVideoStreams() { return Collections.emptyList(); } @Override - public List getVideoOnlyStreams() throws IOException, ExtractionException { + public List getVideoOnlyStreams() { return Collections.emptyList(); } @Override @Nonnull - public List getSubtitlesDefault() throws IOException, ExtractionException { + public List getSubtitlesDefault() { return Collections.emptyList(); } @Override @Nonnull - public List getSubtitles(MediaFormat format) throws IOException, ExtractionException { + public List getSubtitles(MediaFormat format) { return Collections.emptyList(); } @@ -262,10 +264,10 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Override public StreamInfoItemsCollector getRelatedStreams() throws IOException, ExtractionException { - StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId()); + final StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId()); - String apiUrl = "https://api-v2.soundcloud.com/tracks/" + urlEncode(getId()) + "/related" - + "?client_id=" + urlEncode(SoundcloudParsingHelper.clientId()); + final String apiUrl = "https://api-v2.soundcloud.com/tracks/" + urlEncode(getId()) + + "/related?client_id=" + urlEncode(SoundcloudParsingHelper.clientId()); SoundcloudParsingHelper.getStreamsFromApi(collector, apiUrl); return collector; @@ -276,40 +278,44 @@ public class SoundcloudStreamExtractor extends StreamExtractor { return null; } + @Nonnull @Override - public String getHost() throws ParsingException { + public String getHost() { + return ""; + } + + @Nonnull + @Override + public String getPrivacy() { + return ""; + } + + @Nonnull + @Override + public String getCategory() { + return ""; + } + + @Nonnull + @Override + public String getLicence() { return ""; } @Override - public String getPrivacy() throws ParsingException { - return ""; - } - - @Override - public String getCategory() throws ParsingException { - return ""; - } - - @Override - public String getLicence() throws ParsingException { - return ""; - } - - @Override - public Locale getLanguageInfo() throws ParsingException { + public Locale getLanguageInfo() { return null; } @Nonnull @Override - public List getTags() throws ParsingException { + public List getTags() { return Collections.emptyList(); } @Nonnull @Override - public String getSupportInfo() throws ParsingException { + public String getSupportInfo() { return ""; } }