Skip to content

Instantly share code, notes, and snippets.

@vivus-ignis
Created February 22, 2012 17:02
Show Gist options
  • Save vivus-ignis/1886040 to your computer and use it in GitHub Desktop.
Save vivus-ignis/1886040 to your computer and use it in GitHub Desktop.
myspace downloader
#!/usr/bin/env tclsh
# 1. login to myspace.com
# 2. go to http://www.myspace.com/music/player
# 3. save page source
# 4. install rtmpdump (brew install --use-clang rtmpdump)
# 5. run this script with path to page source as parameter
proc flatten {list} {
while {1} {
set lt [join $list]
if {[llength $lt]==[llength $list]} {
return $list
} else {
set list $lt
}
}
}
set fd [open [lindex $::argv 0]]
while { [gets $fd line] >= 0} {
set res [regexp -all -inline {rtmpte://.*?\.mp3} $line]
if { [string length $res] > 0 } { lappend links $res }
}
set cnt 0
foreach link [flatten $links] {
puts "Dumping $link..."
exec rtmpdump -l 2 -r $link -o $cnt.mp3 -q -W "http://lads.myspacecdn.com/videos/MSMusicPlayer.swf"
incr cnt
}
close $fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment