Class SoundcloudParsingHelper
- java.lang.Object
-
- org.schabi.newpipe.extractor.services.soundcloud.SoundcloudParsingHelper
-
public final class SoundcloudParsingHelper extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SOUNDCLOUD_API_V2_URL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
clientId()
static java.util.List<Image>
getAllImagesFromArtworkOrAvatarUrl(java.lang.String originalArtworkOrAvatarUrl)
static java.util.List<Image>
getAllImagesFromTrackObject(com.grack.nanojson.JsonObject trackObject)
static java.util.List<Image>
getAllImagesFromVisualUrl(java.lang.String originalVisualUrl)
static java.lang.String
getAvatarUrl(com.grack.nanojson.JsonObject object)
static java.lang.String
getInfoItemsFromApi(MultiInfoItemsCollector collector, java.lang.String apiUrl)
static java.lang.String
getStreamsFromApi(StreamInfoItemsCollector collector, java.lang.String apiUrl)
static java.lang.String
getStreamsFromApi(StreamInfoItemsCollector collector, java.lang.String apiUrl, boolean charts)
Fetch the streams from the given API and commit each of them to the collector.static java.lang.String
getStreamsFromApiMinItems(int minItems, StreamInfoItemsCollector collector, java.lang.String apiUrl)
Fetch the streams from the given API and commit each of them to the collector.static java.lang.String
getUploaderName(com.grack.nanojson.JsonObject object)
static java.lang.String
getUploaderUrl(com.grack.nanojson.JsonObject object)
static java.lang.String
getUsersFromApi(ChannelInfoItemsCollector collector, java.lang.String apiUrl)
Fetch the user items from the given API and commit each of them to the collector.static java.lang.String
getUsersFromApiMinItems(int minItems, ChannelInfoItemsCollector collector, java.lang.String apiUrl)
Fetch the users from the given API and commit each of them to the collector.static java.time.OffsetDateTime
parseDateFrom(java.lang.String textualUploadDate)
static com.grack.nanojson.JsonObject
resolveFor(Downloader downloader, java.lang.String url)
Call the endpoint "/resolve" of the API.static java.lang.String
resolveIdWithWidgetApi(java.lang.String urlString)
Fetch the widget API with the url and return the id (like the id from the json API).static java.lang.String
resolveUrlWithEmbedPlayer(java.lang.String apiUrl)
Fetch the embed player with the apiUrl and return the canonical url (like the permalink_url from the json API).
-
-
-
Field Detail
-
SOUNDCLOUD_API_V2_URL
public static final java.lang.String SOUNDCLOUD_API_V2_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
clientId
public static java.lang.String clientId() throws ExtractionException, java.io.IOException
- Throws:
ExtractionException
java.io.IOException
-
parseDateFrom
public static java.time.OffsetDateTime parseDateFrom(java.lang.String textualUploadDate) throws ParsingException
- Throws:
ParsingException
-
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
-
getUsersFromApiMinItems
public static java.lang.String getUsersFromApiMinItems(int minItems, ChannelInfoItemsCollector collector, java.lang.String apiUrl) throws java.io.IOException, ReCaptchaException, ParsingException
Fetch the users from the given API and commit each of them to the collector.This differ from
getUsersFromApi(ChannelInfoItemsCollector, String)
in the sense that they will always get MIN_ITEMS or more.- Parameters:
minItems
- the method will return only when it have extracted that many items (equal or more)- Throws:
java.io.IOException
ReCaptchaException
ParsingException
-
getUsersFromApi
@Nonnull public static java.lang.String getUsersFromApi(ChannelInfoItemsCollector collector, java.lang.String apiUrl) throws java.io.IOException, ReCaptchaException, ParsingException
Fetch the user items from the given API and commit each of them to the collector.- Returns:
- the next streams url, empty if don't have
- Throws:
java.io.IOException
ReCaptchaException
ParsingException
-
getStreamsFromApiMinItems
public static java.lang.String getStreamsFromApiMinItems(int minItems, StreamInfoItemsCollector collector, java.lang.String apiUrl) throws java.io.IOException, ReCaptchaException, ParsingException
Fetch the streams from the given API and commit each of them to the collector.This differ from
getStreamsFromApi(StreamInfoItemsCollector, String)
in the sense that they will always get MIN_ITEMS or more items.- Parameters:
minItems
- the method will return only when it have extracted that many items (equal or more)- Throws:
java.io.IOException
ReCaptchaException
ParsingException
-
getStreamsFromApi
@Nonnull public static java.lang.String getStreamsFromApi(StreamInfoItemsCollector collector, java.lang.String apiUrl, boolean charts) throws java.io.IOException, ReCaptchaException, ParsingException
Fetch the streams from the given API and commit each of them to the collector.- Returns:
- the next streams url, empty if don't have
- Throws:
java.io.IOException
ReCaptchaException
ParsingException
-
getStreamsFromApi
public static java.lang.String getStreamsFromApi(StreamInfoItemsCollector collector, java.lang.String apiUrl) throws ReCaptchaException, ParsingException, java.io.IOException
- Throws:
ReCaptchaException
ParsingException
java.io.IOException
-
getInfoItemsFromApi
public static java.lang.String getInfoItemsFromApi(MultiInfoItemsCollector collector, java.lang.String apiUrl) throws ReCaptchaException, ParsingException, java.io.IOException
- Throws:
ReCaptchaException
ParsingException
java.io.IOException
-
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)
-
-