#NEWLINE# def resolve( url ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# id = urlparse . urlparse ( url ) . path . split ( '/' ) [ ( - 1 ) ] #NEWLINE# result = client . request ( url ) #NEWLINE# result = result . replace ( '\r' , '' ) . replace ( '\n' , '' ) . replace ( '\t' , '' ) #NEWLINE# result = result . split ( ( '"%s"' % id ) ) [ ( - 1 ) ] . split ( ']]' ) [ 0 ] #NEWLINE# result = re . compile ( '\\d*,\\d*,\\d*,"(.+?)"' ) . findall ( result ) #NEWLINE# result = [ i . replace ( '\\u003d' , '=' ) . replace ( '\\u0026' , '&' ) for i in result ] [ : : ( - 1 ) ] #NEWLINE# result = sum ( [ tag ( i ) for i in result ] , [ ] ) #NEWLINE# url = [ ] #NEWLINE# try : #NEWLINE# #INDENT# url += [ [ i for i in result if ( i [ 'quality' ] == '1080p' ) ] [ 0 ] ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# url += [ [ id for i in result if ( i [ 'quality' ] == 'HD' ) ] [ 0 ] ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# url += [ [ i for i in result if ( i [ 'quality' ] == 'SD' ) ] [ 0 ] ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# if ( url == [ ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# return url #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return