Created
October 19, 2009 04:57
-
-
Save loganj/213083 to your computer and use it in GitHub Desktop.
This file contains 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
package scamz | |
import org.apache.commons.codec.binary.Base64 | |
import io.Source | |
import xml.{Node, XML} | |
import java.io.{FileOutputStream, File} | |
import scalax.io.{OutputStreamResource, InputStreamResource} | |
object Scamz extends AmazonCipherFactory { | |
def main(args: Array[String]) : Unit = { | |
val encrypted = new Base64().decode(Source.fromFile(args(0)).mkString); | |
val decrypted = XML.loadString(new String(amazonCipher.doFinal(encrypted)).trim) | |
val tracks = (decrypted \\ "track") | |
tracks.foreach( track => { | |
val url = (track \ "location").text | |
val file = (track \ "trackNum").text + " - " + (track \ "title").text + ".mp3" | |
println(file) | |
InputStreamResource.url(url).pumpTo(OutputStreamResource.file(file)) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment