#NEWLINE# def resolve( url ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# url = re . compile ( '//.+?/([\\w]+)' ) . findall ( url ) [ 0 ] #NEWLINE# url = ( 'http://streamcloud.eu/%s' % url ) #NEWLINE# result = client . request ( url ) #NEWLINE# post = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# f = client . parseDOM ( result , 'form' , attrs = { #NEWLINE# #INDENT# 'class' : 'proform' , #NEWLINE# #UNINDENT# } ) [ 0 ] #NEWLINE# k = client . parseDOM ( f , 'input' , ret = 'name' , attrs = { #NEWLINE# #INDENT# 'type' : 'hidden' , #NEWLINE# #UNINDENT# } ) #NEWLINE# for i in k : #NEWLINE# #INDENT# post . update ( { #NEWLINE# #INDENT# i : client . parseDOM ( f , 'input' , ret = 'value' , attrs = { #NEWLINE# #INDENT# 'name' : i , #NEWLINE# #UNINDENT# } ) [ 0 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# post = post . replace ( 'op=download1' , 'op=download2' ) #NEWLINE# result = client . request ( url , post = post ) #NEWLINE# url = re . compile ( 'file *: *"(http.+?)"' ) . findall ( result ) [ ( - 1 ) ] #NEWLINE# return url #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return