Skip to content

Instantly share code, notes, and snippets.

@suziewong suziewong/5sing
Created Nov 26, 2013

What would you like to do?
# encoding=utf-8
import urllib
import urllib2
import re
urls = ['','']
music_links = []
for i in urls:
source = urllib.urlopen(i).read()
matches = re.compile(r'style="display:none"/><a href="(.*?)" target="_blank">(.*?)</a>')
music_links += matches.findall(source)
for link in music_links:
source = urllib.urlopen(link[0]).read()
pat = re.compile(r'file: "(.*?)"')
mlink = pat.findall(source)[0]
urllib.urlretrieve(mlink, 'music/'+link[1]+'.mp3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.