{"id":546,"date":"2011-05-23T12:48:27","date_gmt":"2011-05-23T12:48:27","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2011\/05\/23\/sound-cloud-downloader-bash-script\/"},"modified":"2021-07-31T18:16:37","modified_gmt":"2021-07-31T18:16:37","slug":"sound-cloud-downloader-bash-script","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html","title":{"rendered":"SoundCloud Downloader BASH Script"},"content":{"rendered":"

SoundCloud allows artists and producers to upload and promote music across the internet.<\/p>\n

This article provides a Linux based script which downloads all tracks for a given artist.<\/p>\n

SCRIPT<\/h3>\n
#!\/bin\/bash\r\n\r\nif [ -z \"$1\" ]; then\r\n        echo \"Usage: `basename $0` [URL]\";\r\n        echo\r\n        echo \"Example:\"\r\n        echo \"   `basename $0` http:\/\/soundcloud.com\/disco-dave\";\r\n        exit\r\nfi\r\n\r\npage=`wget $1 -q --user-agent='Mozilla\/5.0' -O -`\r\npagetotal=`echo \"$page\" | tr '\"' \"\\n\" | grep \"tracks?page=\" | sort -u | tail -n 1 | cut -d \"=\" -f 2`\r\n\r\necho \"[*] Processing ...\"\r\n\r\nx=1\r\nwhile [ $x -le $((`echo $pagetotal`)) ]\r\ndo\r\n        page=`wget $1\/tracks?page=\"${x}\" -q --user-agent='Mozilla\/5.0' -O -`\r\n        songs=`echo \"${page}\" | grep 'streamUrl' | tr '\"' \"\\n\" | grep 'http:\/\/media.soundcloud.com\/stream\/'`;\r\n        titles=`echo \"${page}\" | grep 'title\":\"' | tr ',' \"\\n\" | grep 'title' | cut -d '\"' -f 4 | sed 's\/\\\/\/ vs \/g'`\r\n        songs2=$songs$'\\n'$songs2\r\n        titles2=$titles$'\\n'$titles2\r\n        x=$(( $x + 1 ))\r\ndone\r\n\r\nif [ -z \"${songs2}\" ]; then\r\n        echo \"No song(s) found at this url.\";\r\n        exit;\r\nfi\r\n\r\nsongcount=$((`echo \"$songs2\" | wc -l` - 1))\r\n\r\necho \"[*] Found $songcount songs!\";\r\n\r\nfor (( songid=1; songid <= $songcount; songid++ ))\r\ndo\r\n        title=`echo \"${titles2}\" | sed -n \"${songid}\"p`\r\n        echo \"[*] Downloading \"${title}\"...\"\r\n        wget -L `echo \"${songs2}\" | sed -n \"${songid}\"p` -q --user-agent='Mozilla\/5.0' -O \"`echo $title`.mp3\";\r\ndone\r\n\r\n<\/pre>\n

EXAMPLE<\/strong><\/h4>\n
root@server]# bash soundcloud.sh http:\/\/soundcloud.com\/djname<\/pre>\n

[*] Processing …
\n[*] Found 18 songs!
\n[*] Downloading song1…<\/p>\n","protected":false},"excerpt":{"rendered":"

SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all tracks for a given artist. SCRIPT #!\/bin\/bash if [ -z “$1” ]; then echo “Usage: `basename $0` [URL]”; echo echo “Example:” echo ” `basename $0` http:\/\/soundcloud.com\/disco-dave”; exit fi page=`wget $1 -q –user-agent=’Mozilla\/5.0′ … Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[],"yoast_head":"\nSoundCloud Downloader BASH Script - Fir3net<\/title>\n<meta name=\"description\" content=\"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SoundCloud Downloader BASH Script - Fir3net\" \/>\n<meta property=\"og:description\" content=\"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\" \/>\n<meta property=\"og:site_name\" content=\"Fir3net\" \/>\n<meta property=\"article:published_time\" content=\"2011-05-23T12:48:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-31T18:16:37+00:00\" \/>\n<meta name=\"author\" content=\"Rick Donato\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Rick Donato\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\"},\"author\":{\"name\":\"Rick Donato\",\"@id\":\"https:\/\/www.fir3net.com\/#\/schema\/person\/ab35009601b7687ee1c5310be6038037\"},\"headline\":\"SoundCloud Downloader BASH Script\",\"datePublished\":\"2011-05-23T12:48:27+00:00\",\"dateModified\":\"2021-07-31T18:16:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\"},\"wordCount\":39,\"publisher\":{\"@id\":\"https:\/\/www.fir3net.com\/#organization\"},\"articleSection\":[\"Shell Scripting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\",\"url\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\",\"name\":\"SoundCloud Downloader BASH Script - Fir3net\",\"isPartOf\":{\"@id\":\"https:\/\/www.fir3net.com\/#website\"},\"datePublished\":\"2011-05-23T12:48:27+00:00\",\"dateModified\":\"2021-07-31T18:16:37+00:00\",\"description\":\"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all\",\"breadcrumb\":{\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.fir3net.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Programming\",\"item\":\"https:\/\/www.fir3net.com\/programming\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Shell Scripting\",\"item\":\"https:\/\/www.fir3net.com\/programming\/shell-scripting\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SoundCloud Downloader BASH Script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.fir3net.com\/#website\",\"url\":\"https:\/\/www.fir3net.com\/\",\"name\":\"Fir3net\",\"description\":\"Keeping you in the know\",\"publisher\":{\"@id\":\"https:\/\/www.fir3net.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.fir3net.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.fir3net.com\/#organization\",\"name\":\"Fir3net\",\"url\":\"https:\/\/www.fir3net.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.fir3net.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.fir3net.com\/wp-content\/uploads\/Fir3net-Background-Logo-compressed.png\",\"contentUrl\":\"https:\/\/www.fir3net.com\/wp-content\/uploads\/Fir3net-Background-Logo-compressed.png\",\"width\":390,\"height\":88,\"caption\":\"Fir3net\"},\"image\":{\"@id\":\"https:\/\/www.fir3net.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.fir3net.com\/#\/schema\/person\/ab35009601b7687ee1c5310be6038037\",\"name\":\"Rick Donato\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.fir3net.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d75d69a54c0ca3b32c24c3a9703b623c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d75d69a54c0ca3b32c24c3a9703b623c?s=96&d=mm&r=g\",\"caption\":\"Rick Donato\"},\"description\":\"Rick Donato is a Network Automation Architect\/Evangelist and the founder of Packet Coders.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SoundCloud Downloader BASH Script - Fir3net","description":"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html","og_locale":"en_US","og_type":"article","og_title":"SoundCloud Downloader BASH Script - Fir3net","og_description":"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all","og_url":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html","og_site_name":"Fir3net","article_published_time":"2011-05-23T12:48:27+00:00","article_modified_time":"2021-07-31T18:16:37+00:00","author":"Rick Donato","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Rick Donato","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#article","isPartOf":{"@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html"},"author":{"name":"Rick Donato","@id":"https:\/\/www.fir3net.com\/#\/schema\/person\/ab35009601b7687ee1c5310be6038037"},"headline":"SoundCloud Downloader BASH Script","datePublished":"2011-05-23T12:48:27+00:00","dateModified":"2021-07-31T18:16:37+00:00","mainEntityOfPage":{"@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html"},"wordCount":39,"publisher":{"@id":"https:\/\/www.fir3net.com\/#organization"},"articleSection":["Shell Scripting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html","url":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html","name":"SoundCloud Downloader BASH Script - Fir3net","isPartOf":{"@id":"https:\/\/www.fir3net.com\/#website"},"datePublished":"2011-05-23T12:48:27+00:00","dateModified":"2021-07-31T18:16:37+00:00","description":"SoundCloud allows artists and producers to upload and promote music across the internet. This article provides a Linux based script which downloads all","breadcrumb":{"@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.fir3net.com\/Programming\/Shell-Scripting\/sound-cloud-downloader-bash-script.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.fir3net.com\/"},{"@type":"ListItem","position":2,"name":"Programming","item":"https:\/\/www.fir3net.com\/programming"},{"@type":"ListItem","position":3,"name":"Shell Scripting","item":"https:\/\/www.fir3net.com\/programming\/shell-scripting"},{"@type":"ListItem","position":4,"name":"SoundCloud Downloader BASH Script"}]},{"@type":"WebSite","@id":"https:\/\/www.fir3net.com\/#website","url":"https:\/\/www.fir3net.com\/","name":"Fir3net","description":"Keeping you in the know","publisher":{"@id":"https:\/\/www.fir3net.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.fir3net.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.fir3net.com\/#organization","name":"Fir3net","url":"https:\/\/www.fir3net.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fir3net.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.fir3net.com\/wp-content\/uploads\/Fir3net-Background-Logo-compressed.png","contentUrl":"https:\/\/www.fir3net.com\/wp-content\/uploads\/Fir3net-Background-Logo-compressed.png","width":390,"height":88,"caption":"Fir3net"},"image":{"@id":"https:\/\/www.fir3net.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.fir3net.com\/#\/schema\/person\/ab35009601b7687ee1c5310be6038037","name":"Rick Donato","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.fir3net.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d75d69a54c0ca3b32c24c3a9703b623c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d75d69a54c0ca3b32c24c3a9703b623c?s=96&d=mm&r=g","caption":"Rick Donato"},"description":"Rick Donato is a Network Automation Architect\/Evangelist and the founder of Packet Coders."}]}},"_links":{"self":[{"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/posts\/546"}],"collection":[{"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/comments?post=546"}],"version-history":[{"count":0,"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/posts\/546\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/media?parent=546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/categories?post=546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fir3net.com\/wp-json\/wp\/v2\/tags?post=546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}