Skip to content

Instantly share code, notes, and snippets.

@lsgrep
Created February 28, 2015 13:12
Show Gist options
  • Select an option

  • Save lsgrep/dae9b5d30b20be06398d to your computer and use it in GitHub Desktop.

Select an option

Save lsgrep/dae9b5d30b20be06398d to your computer and use it in GitHub Desktop.
Getting mp3 links from music site
(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