#NEWLINE# def tag( url ) : #NEWLINE# #INDENT# quality = re . compile ( 'itag=(\\d*)' ) . findall ( url ) #NEWLINE# quality += re . compile ( '=m(\\d*)$' ) . findall ( url ) #NEWLINE# try : #NEWLINE# #INDENT# quality = quality [ 0 ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# if ( quality in [ '37' , '137' , '299' , '96' , '248' , '303' , '46' ] ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'quality' : '1080p' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( quality in [ '22' , '84' , '136' , '298' , '120' , '95' , '247' , '302' , '45' , '102' ] ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'quality' : 'HD' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( quality in [ '35' , '44' , '135' , '244' , '94' ] ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'quality' : 'SD' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( quality in [ '18' , '34' , '43' , '82' , '100' , '101' , '134' , '243' , '93' ] ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'quality' : 'SD' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( quality in [ '5' , '6' , '36' , '83' , '133' , '242' , '92' , '132' ] ) : #NEWLINE# #INDENT# return [ { #NEWLINE# #INDENT# 'quality' : 'SD' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return [ ]