aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/Soundcloud.cpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-03-26 17:33:33 +0100
committerdec05eba <dec05eba@protonmail.com>2021-03-26 17:33:33 +0100
commit8fc6edc4033c04de3cdc6a400976a019a35694b7 (patch)
tree446627137ce186516a5f5cfa6e59b72831fcb820 /src/plugins/Soundcloud.cpp
parentda827778f8c5d2f0cfc56b297099ba58454c38ed (diff)
Soundcloud: autoplay next song in list
Diffstat (limited to 'src/plugins/Soundcloud.cpp')
-rw-r--r--src/plugins/Soundcloud.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/Soundcloud.cpp b/src/plugins/Soundcloud.cpp
index cfb6011..37538ed 100644
--- a/src/plugins/Soundcloud.cpp
+++ b/src/plugins/Soundcloud.cpp
@@ -284,4 +284,21 @@ namespace QuickMedia {
if(result != DownloadResult::OK) return download_result_to_plugin_result(result);
return parse_user_page(json_root, result_items, next_href);
}
+
+ std::string SoundcloudAudioPage::url_get_playable_url(const std::string &url) {
+ std::string query_url = url + "?client_id=" + client_id;
+
+ Json::Value json_root;
+ DownloadResult result = download_json(json_root, query_url, {}, true);
+ if(result != DownloadResult::OK) return url;
+
+ if(!json_root.isObject())
+ return url;
+
+ const Json::Value &url_json = json_root["url"];
+ if(!url_json.isString())
+ return url;
+
+ return url_json.asString();
+ }
} \ No newline at end of file