Search in sources :

Example 1 with SoundcloudSearchResult

use of com.frostwire.search.soundcloud.SoundcloudSearchResult in project frostwire by frostwire.

the class DownloadSoundcloudFromUrlTask method doInBackground.

@Override
protected List<SoundcloudSearchResult> doInBackground() {
    List<SoundcloudSearchResult> results = new ArrayList<>();
    try {
        String url = soundcloudUrl;
        if (soundcloudUrl.contains("?in=")) {
            url = soundcloudUrl.substring(0, url.indexOf("?in="));
        }
        String resolveURL = SoundcloudSearchPerformer.resolveUrl(url);
        HttpClient client = HttpClientFactory.getInstance(HttpClientFactory.HttpContext.DOWNLOAD);
        String json = client.get(resolveURL, 10000);
        results = SoundcloudSearchPerformer.fromJson(json);
    } catch (Throwable e) {
        e.printStackTrace();
    }
    return results;
}
Also used : HttpClient(com.frostwire.util.http.HttpClient) ArrayList(java.util.ArrayList) SoundcloudSearchResult(com.frostwire.search.soundcloud.SoundcloudSearchResult)

Aggregations

SoundcloudSearchResult (com.frostwire.search.soundcloud.SoundcloudSearchResult)1 HttpClient (com.frostwire.util.http.HttpClient)1 ArrayList (java.util.ArrayList)1