{"id":101,"date":"2016-08-06T05:25:38","date_gmt":"2016-08-06T05:25:38","guid":{"rendered":"http:\/\/wizardofbots.com\/network\/?p=101"},"modified":"2016-08-09T03:52:57","modified_gmt":"2016-08-09T03:52:57","slug":"cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row","status":"publish","type":"post","link":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/","title":{"rendered":"Cool script to download full mp3 albums from specific artist in a row"},"content":{"rendered":"<p>Hey wazzaaaaaAAA!<\/p>\n<p>Well fuckers, we have something pretty cool today for all the music lovers, even we the bots love it, without it everything will be meaningless with lack of color in life.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif\" width=\"320\" height=\"240\" \/><\/p>\n<p>To the point, what we are going to do:<\/p>\n<ol>\n<li>Automatically search for google results using a <strong>dork<\/strong>(explained below) for mp3.<\/li>\n<li>Grab the first 5 results from google.<\/li>\n<li>Download all mp3 files located on\u00a0those urls.<\/li>\n<\/ol>\n<p>A\u00a0<strong>google dork<\/strong> is a search command that will display pages with\u00a0folders full of specific\u00a0filetypes or more, so if you don&#8217;t know how to search you should do it this way:<\/p>\n<blockquote><p>&#8220;index of&#8221; + &#8220;mp3&#8221; + &#8220;radiohead&#8221; -html -htm -php<\/p><\/blockquote>\n<p>so this will look for folders (index of) that contains\u00a0<strong>mp3<\/strong> with the keyword\u00a0<strong>radiohead<\/strong> and only display html, html and php pages.<\/p>\n<h3>The code is commented and well explained, if questions leave a comment.<\/h3>\n<p>The code is the same as we preview before in other posts, we have to define the search url using the dork, so we loop the first 5 results:<\/p>\n<pre class=\"lang:php decode:true  \">&lt;?php\r\nrequire_once('simple_html_dom.php'); \/\/ we need this library to parse\r\n$keyword = urlencode('\"index of\" + \"mp3\" + \"radiohead\" -html -htm -php'); \/\/the google dork escaped\r\n$counter = 0; \/\/set the counter to just do it the first 5 links.\r\n$limit = 10; \/\/ e limit to 5\r\n$google  = 'http:\/\/www.google.com\/search?q=' . $keyword .'&amp;num=50';\r\n\/\/ we start searching in google ;)\r\necho '#####################################';\r\necho '###        SEARCHING IN GOOGLE    ####';\r\necho '#####################################';\r\n$html = file_get_html($google);\r\n$linkObjs = $html-&gt;find('h3.r a');\r\nforeach ($linkObjs as $linkObj) {\r\n    $title = trim($linkObj-&gt;plaintext);\r\n    $link  = trim($linkObj-&gt;href);\r\n    \/\/ if it is not a direct link but url reference found inside it, then extract\r\n    if (!preg_match('\/^https?\/', $link) &amp;&amp; preg_match('\/q=(.+)&amp;amp;sa=\/U', $link, $matches) &amp;&amp; preg_match('\/^https?\/', $matches[1])) {\r\n        $link = $matches[1];\r\n    } else if (!preg_match('\/^https?\/', $link)) { \/\/ skip if it is not a valid link\r\n        continue;    \r\n    }\r\n    \r\n    print 'Title: ' . $title . '\\n';\r\n    print 'Link: ' . $link . '\\n';   \r\n    if($counter &lt;= $limit ) { \/\/logic for only the limit you decide on the config\r\n      \/\/this is very interesting, you can do it with also the below commented alternative\r\n      $cmd = \"wget -A mp3 -m -p -E -k -K -np \". $link;\r\n      \/\/$cmd = \"wget --accept mp3 --mirror --progress --adjust-extension --convert-links --backup-converted --no-parent \".$link;\r\n      exec($cmd);\r\n      $counter++;\r\n    } \r\n}\r\n?&gt;<\/pre>\n<p>The point of this script is to download all the mp3 files you want from your favorite artist, don&#8217;t worry it will separate all the grabbed content into specific folder for each of the domain that was used to download them and respective folders, so you can navigate to each and select the final mp3 that will remain with you and erase the others.<\/p>\n<p>What do you think? Ready to party?<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-109\" src=\"http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj-300x217.jpg\" alt=\"robotdj\" width=\"300\" height=\"217\" srcset=\"http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj-300x217.jpg 300w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj-600x434.jpg 600w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj-768x555.jpg 768w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj-1024x740.jpg 1024w, http:\/\/wizardofbots.com\/network\/wp-content\/uploads\/2016\/08\/robotdj.jpg 1600w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey wazzaaaaaAAA! Well fuckers, we have something pretty cool today for all the music lovers, even we the bots love it, without it everything will be meaningless with lack of color in life. To the point, what we are going to do: Automatically search for google results using a dork(explained below) for mp3. Grab the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[10,6],"tags":[53,14,54,31],"class_list":["post-101","post","type-post","status-publish","format-standard","hentry","category-php","category-tutorials","tag-download-mp3","tag-php","tag-php-script","tag-script"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots\" \/>\n<meta property=\"og:description\" content=\"Hey wazzaaaaaAAA! Well fuckers, we have something pretty cool today for all the music lovers, even we the bots love it, without it everything will be meaningless with lack of color in life. To the point, what we are going to do: Automatically search for google results using a dork(explained below) for mp3. Grab the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/\" \/>\n<meta property=\"og:site_name\" content=\"Wizard Of Bots\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-06T05:25:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-08-09T03:52:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif\" \/>\n<meta name=\"author\" content=\"wizardofbots\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wizardofbots\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/\",\"url\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/\",\"name\":\"Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots\",\"isPartOf\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage\"},\"image\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif\",\"datePublished\":\"2016-08-06T05:25:38+00:00\",\"dateModified\":\"2016-08-09T03:52:57+00:00\",\"author\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f\"},\"breadcrumb\":{\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage\",\"url\":\"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif\",\"contentUrl\":\"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/wizardofbots.com\/network\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cool script to download full mp3 albums from specific artist in a row\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#website\",\"url\":\"http:\/\/wizardofbots.com\/network\/\",\"name\":\"Wizard Of Bots\",\"description\":\"Botting and AI community\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/wizardofbots.com\/network\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f\",\"name\":\"wizardofbots\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g\",\"contentUrl\":\"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g\",\"caption\":\"wizardofbots\"},\"url\":\"http:\/\/wizardofbots.com\/network\/author\/wizardofbots\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots","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":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/","og_locale":"en_US","og_type":"article","og_title":"Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots","og_description":"Hey wazzaaaaaAAA! Well fuckers, we have something pretty cool today for all the music lovers, even we the bots love it, without it everything will be meaningless with lack of color in life. To the point, what we are going to do: Automatically search for google results using a dork(explained below) for mp3. Grab the [&hellip;]","og_url":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/","og_site_name":"Wizard Of Bots","article_published_time":"2016-08-06T05:25:38+00:00","article_modified_time":"2016-08-09T03:52:57+00:00","og_image":[{"url":"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif"}],"author":"wizardofbots","twitter_card":"summary_large_image","twitter_misc":{"Written by":"wizardofbots","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/","url":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/","name":"Cool script to download full mp3 albums from specific artist in a row - Wizard Of Bots","isPartOf":{"@id":"http:\/\/wizardofbots.com\/network\/#website"},"primaryImageOfPage":{"@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage"},"image":{"@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage"},"thumbnailUrl":"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif","datePublished":"2016-08-06T05:25:38+00:00","dateModified":"2016-08-09T03:52:57+00:00","author":{"@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f"},"breadcrumb":{"@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#primaryimage","url":"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif","contentUrl":"https:\/\/media.giphy.com\/media\/1Mng0gXC5Tpcs\/giphy.gif"},{"@type":"BreadcrumbList","@id":"http:\/\/wizardofbots.com\/network\/cool-script-to-download-full-mp3-albums-from-specific-artist-in-a-row\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/wizardofbots.com\/network\/"},{"@type":"ListItem","position":2,"name":"Cool script to download full mp3 albums from specific artist in a row"}]},{"@type":"WebSite","@id":"http:\/\/wizardofbots.com\/network\/#website","url":"http:\/\/wizardofbots.com\/network\/","name":"Wizard Of Bots","description":"Botting and AI community","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/wizardofbots.com\/network\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/31f9e486da1c11791d94a861854a2a9f","name":"wizardofbots","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/wizardofbots.com\/network\/#\/schema\/person\/image\/","url":"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g","contentUrl":"http:\/\/2.gravatar.com\/avatar\/584eebc303f64610559ab9f305f6928d?s=96&d=mm&r=g","caption":"wizardofbots"},"url":"http:\/\/wizardofbots.com\/network\/author\/wizardofbots\/"}]}},"_links":{"self":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/101"}],"collection":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/comments?post=101"}],"version-history":[{"count":10,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/101\/revisions"}],"predecessor-version":[{"id":133,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/posts\/101\/revisions\/133"}],"wp:attachment":[{"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/media?parent=101"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/categories?post=101"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wizardofbots.com\/network\/wp-json\/wp\/v2\/tags?post=101"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}