#NEWLINE# def qjwm_link( url ) : #NEWLINE# #INDENT# assert re . match ( 'http://.*\\.qjwm\\.com/down(load)?_\\d+.html' , url ) #NEWLINE# url = url . replace ( '/down_' , '/download_' ) #NEWLINE# html = urllib2 . urlopen ( url ) . read ( ) #NEWLINE# m = re . search ( 'var thunder_url = "([^"]+)";' , html ) #NEWLINE# if m : #NEWLINE# #INDENT# url = m . group ( 1 ) #NEWLINE# url = url . decode ( 'gbk' ) #NEWLINE# return url