Created
February 28, 2015 13:12
-
-
Save lsgrep/dae9b5d30b20be06398d to your computer and use it in GitHub Desktop.
Getting mp3 links from music site
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (def song-url "http://www.mzhiphop.com/song-17803-Usher---Paradise") | |
| (def song-static "http://www.sharebeast.com/mp3embed-") | |
| (defn get-download-url [url] | |
| (str song-static | |
| (second | |
| (str/split (second | |
| (str/split | |
| (get-in (nth | |
| (html/select | |
| (html/html-resource | |
| (html/html-snippet | |
| (:body (http/get url)))) | |
| [:iframe]) 2) [:attrs :src]) #"&")) #"=")) ".mp3")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment