Class SoundcloudParsingHelper


  • public final class SoundcloudParsingHelper
    extends java.lang.Object
    • Field Detail

      • SOUNDCLOUD_API_V2_URL

        public static final java.lang.String SOUNDCLOUD_API_V2_URL
        See Also:
        Constant Field Values
    • Method Detail

      • resolveFor

        public static com.grack.nanojson.JsonObject resolveFor​(@Nonnull
                                                               Downloader downloader,
                                                               java.lang.String url)
                                                        throws java.io.IOException,
                                                               ExtractionException
        Call the endpoint "/resolve" of the API.

        See https://developers.soundcloud.com/docs/api/reference#resolve

        Throws:
        java.io.IOException
        ExtractionException
      • resolveUrlWithEmbedPlayer

        public static java.lang.String resolveUrlWithEmbedPlayer​(java.lang.String apiUrl)
                                                          throws java.io.IOException,
                                                                 ReCaptchaException
        Fetch the embed player with the apiUrl and return the canonical url (like the permalink_url from the json API).
        Returns:
        the url resolved
        Throws:
        java.io.IOException
        ReCaptchaException
      • resolveIdWithWidgetApi

        public static java.lang.String resolveIdWithWidgetApi​(java.lang.String urlString)
                                                       throws java.io.IOException,
                                                              ParsingException
        Fetch the widget API with the url and return the id (like the id from the json API).
        Returns:
        the resolved id
        Throws:
        java.io.IOException
        ParsingException
      • getUploaderUrl

        @Nonnull
        public static java.lang.String getUploaderUrl​(com.grack.nanojson.JsonObject object)
      • getAvatarUrl

        @Nonnull
        public static java.lang.String getAvatarUrl​(com.grack.nanojson.JsonObject object)
      • getUploaderName

        @Nonnull
        public static java.lang.String getUploaderName​(com.grack.nanojson.JsonObject object)
      • getAllImagesFromTrackObject

        @Nonnull
        public static java.util.List<Image> getAllImagesFromTrackObject​(@Nonnull
                                                                        com.grack.nanojson.JsonObject trackObject)
                                                                 throws ParsingException
        Throws:
        ParsingException
      • getAllImagesFromArtworkOrAvatarUrl

        @Nonnull
        public static java.util.List<Image> getAllImagesFromArtworkOrAvatarUrl​(@Nullable
                                                                               java.lang.String originalArtworkOrAvatarUrl)
      • getAllImagesFromVisualUrl

        @Nonnull
        public static java.util.List<Image> getAllImagesFromVisualUrl​(@Nullable
                                                                      java.lang.String originalVisualUrl)