diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelInfoItemExtractor.java index dcc6c20c0..118b59cc0 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudChannelInfoItemExtractor.java @@ -24,7 +24,9 @@ public class SoundcloudChannelInfoItemExtractor implements ChannelInfoItemExtrac @Override public String getThumbnailUrl() { - return itemObject.getString("avatar_url", ""); + String avatarUrl = itemObject.getString("avatar_url", ""); + String avatarUrlBetterResolution = avatarUrl.replace("large.jpg", "crop.jpg"); + return avatarUrlBetterResolution; } @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java index e6d74b200..2c27fa91d 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistExtractor.java @@ -71,13 +71,15 @@ public class SoundcloudPlaylistExtractor extends PlaylistExtractor { final String thumbnailUrl = item.getThumbnailUrl(); if (thumbnailUrl == null || thumbnailUrl.isEmpty()) continue; - return thumbnailUrl; + String thumbnailUrlBetterResolution = thumbnailUrl.replace("large.jpg", "crop.jpg"); + return thumbnailUrlBetterResolution; } } catch (Exception ignored) { } } - return artworkUrl; + String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); + return artworkUrlBetterResolution; } @Override diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistInfoItemExtractor.java index 4a6b4f1e2..53123859b 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudPlaylistInfoItemExtractor.java @@ -32,7 +32,10 @@ public class SoundcloudPlaylistInfoItemExtractor implements PlaylistInfoItemExtr // Over-engineering at its finest if (itemObject.isString(ARTWORK_URL_KEY)) { final String artworkUrl = itemObject.getString(ARTWORK_URL_KEY, ""); - if (!artworkUrl.isEmpty()) return artworkUrl; + if (!artworkUrl.isEmpty()) { + String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); + return artworkUrlBetterResolution; + } } try { @@ -42,8 +45,11 @@ public class SoundcloudPlaylistInfoItemExtractor implements PlaylistInfoItemExtr // First look for track artwork url if (trackObject.isString(ARTWORK_URL_KEY)) { - final String url = trackObject.getString(ARTWORK_URL_KEY, ""); - if (!url.isEmpty()) return url; + String artworkUrl = trackObject.getString(ARTWORK_URL_KEY, ""); + if (!artworkUrl.isEmpty()) { + String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); + return artworkUrlBetterResolution; + } } // Then look for track creator avatar url diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java index 005722e3e..f5860d835 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamExtractor.java @@ -57,7 +57,12 @@ public class SoundcloudStreamExtractor extends StreamExtractor { @Nonnull @Override public String getThumbnailUrl() { - return track.getString("artwork_url", ""); + String artworkUrl = track.getString("artwork_url", ""); + if (artworkUrl.isEmpty()) { + artworkUrl = track.getObject("user").getString("avatar_url", ""); + } + String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); + return artworkUrlBetterResolution; } @Nonnull diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamInfoItemExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamInfoItemExtractor.java index 358f32da0..09455e193 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamInfoItemExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudStreamInfoItemExtractor.java @@ -52,7 +52,12 @@ public class SoundcloudStreamInfoItemExtractor implements StreamInfoItemExtracto @Override public String getThumbnailUrl() { - return itemObject.getString("artwork_url"); + String artworkUrl = itemObject.getString("artwork_url", ""); + if (artworkUrl.isEmpty()) { + artworkUrl = itemObject.getObject("user").getString("avatar_url"); + } + String artworkUrlBetterResolution = artworkUrl.replace("large.jpg", "crop.jpg"); + return artworkUrlBetterResolution; } @Override