Skip to content

Instantly share code, notes, and snippets.

@ThenTech
Last active March 18, 2021 05:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ThenTech/6fc8c1aabfa27d0532bf to your computer and use it in GitHub Desktop.
Save ThenTech/6fc8c1aabfa27d0532bf to your computer and use it in GitHub Desktop.
SoundCloud Download user script
// ==UserScript==
// @name SoundCloud Downloader Fix
// @namespace http://sc-downloader.com
// @author Usama Ejaz, Wosser1's Productions
// @description Adds a Download button to all the tracks on SoundCloud (works with the new SoundCloud interface)
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js
// @include http://www.soundcloud.com/*
// @include http://soundcloud.com/*
// @include https://www.soundcloud.com/*
// @include https://soundcloud.com/*
// @grant GM_getValue
// @grant GM_setValue
// @grant GM_openInTab
// @version 0.4
// ==/UserScript==
//-----------------------------------------------------------------------------------
var isfirstrun = GM_getValue('scd_firstrun', '0');
if (isfirstrun == '0')
{
GM_openInTab('http://sc-downloader.com/?utm_source=userscriptinstall');
GM_setValue('scd_firstrun', '1');
}
jQuery.noConflict();
(function($){
$( addBtns = function(){
// $("head").append('<style>#scd_usamaejaz:before {padding-left: 20px;content: " ";}</style>');
//setInterval(function(){
if(!$(".sound").is(".playlist")){
if($("#scd_usamaejaz").length==0) {
title=$(".soundTitle__title").eq(0).text();
title = title.replace(/"/g, "'");
url=document.location.href;
$(".soundActions .sc-button-group-medium").eq(0).append('<a class="sc-button sc-button-medium sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url='+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz">Download</a>');
}
} else {
$(".trackList .trackList__item").each(function(){
if($(this).find("#scd_usamaejaz1").length==0){
title=$(this).find(".soundTitle__title").eq(0).text();
title = title.replace(/"/g, "'");
url=$(this).find(".soundTitle__title").eq(0).attr("href");
$(this).find('.soundActions .sc-button-group-small').eq(0).append('<a class="sc-button sc-button-small sc-button-icon sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url=http://soundcloud.com'+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz1">Download</a>');
}
});
}
$(".soundList__item > .activity").each(function(){
if(!$(this).find(".sound").is(".playlist")){
if($(this).find("#scd_usamaejaz").length==0){
title=$(this).find(".soundTitle__title").eq(0).text();title = title.replace(/"/g, "'");
url=$(this).find(".soundTitle__title").eq(0).attr("href");
$(this).find('.soundActions .sc-button-group-small').eq(0).append('<a class="sc-button sc-button-small sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url=http://soundcloud.com'+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz">Download</a>');
}
}
});
$(".userStream").find(".soundList__item > .userStreamItem").each(function(){
if(!$(this).find(".sound").is(".playlist")){
if($(this).find("#scd_usamaejaz1").length==0){
title=$(this).find(".soundTitle__title").eq(0).text();title = title.replace(/"/g, "'");
url=$(this).find(".soundTitle__title").eq(0).attr("href");
$(this).find('.soundActions .sc-button-group-small').eq(0).append('<a class="sc-button sc-button-small sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url=http://soundcloud.com'+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz1">Download</a>');
}
}
});
$("div.explore").find(".soundList__item > .sound").each(function(){
if(!$(this).find(".sound").is(".playlist")){
if($(this).find("#scd_usamaejaz").length==0){
title=$(this).find(".soundTitle__title").eq(0).text();title = title.replace(/"/g, "'");
url=$(this).find(".soundTitle__title").eq(0).attr("href");
$(this).find('.soundActions .sc-button-group-small').eq(0).append('<a class="sc-button sc-button-small sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url=http://soundcloud.com'+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz">Download</a>');
}
}
});
$(".searchList__item > .searchItem").each(function(){
if(!$(this).find(".sound").is(".playlist")){
if($(this).find("#scd_usamaejaz").length==0){
title=$(this).find(".soundTitle__title").eq(0).text();title = title.replace(/"/g, "'");
url=$(this).find(".soundTitle__title").eq(0).attr("href");
$(this).find('.soundActions .sc-button-group-small').eq(0).append('<a class="sc-button sc-button-small sc-button-responsive sc-button-download" target="_blank" href="http://sc-downloader.com/download.php?url=http://soundcloud.com'+url+'&utm_source=scduserscript" title="Download '+title+'" id="scd_usamaejaz">Download</a>');
}
}
});
if(($(".userStream__visualUser").length==1) && ($("#dscd1bg").length==0)){
$("head").append('<style id="dscd1bg">#scd_usamaejaz1{ background-image:none !important;}</style>');
}
//}, 1000);
});
})(jQuery);
setInterval(addBtns, 8000);
@WiMedley
Copy link

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment