#NEWLINE# def get_sources( self , url , hosthdDict , hostDict , locDict ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# sources = [ ] #NEWLINE# if ( url == None ) : #NEWLINE# #INDENT# return sources #NEWLINE# #UNINDENT# query = urlparse . urlparse ( url ) . query #NEWLINE# try : #NEWLINE# #INDENT# query = ( '%02d' % int ( re . compile ( 'E(\\d*)$' ) . findall ( query ) [ 0 ] ) ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# query = '' #NEWLINE# #UNINDENT# url = urlparse . urljoin ( self . base_link , url ) #NEWLINE# result = client . source ( url ) #NEWLINE# result = client . parseDOM ( result , 'select' , attrs = { #NEWLINE# #INDENT# 'id' : 'myDropdown' , #NEWLINE# #UNINDENT# } ) [ 0 ] #NEWLINE# result = zip ( client . parseDOM ( result , 'option' , ret = 'value' ) , client . parseDOM ( result , 'option' ) ) #NEWLINE# result = [ i [ 0 ] for i in result if ( i [ 1 ] . endswith ( query ) or ( query == '' ) ) ] [ 0 ] #NEWLINE# direct = re . compile ( '(.+)[|](.+?)[,]' ) . findall ( hostDict ) #NEWLINE# if ( len ( direct ) > 0 ) : #NEWLINE# #INDENT# quality = ( 'HD' if ( 'hd' in direct [ 0 ] [ 0 ] . lower ( ) ) else 'SD' ) #NEWLINE# sources . append ( { #NEWLINE# #INDENT# 'source' : 'MVsnap' , #NEWLINE# 'quality' : quality , #NEWLINE# 'provider' : 'MVsnap' , #NEWLINE# 'url' : direct [ 0 ] [ 1 ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# return sources #NEWLINE# #UNINDENT# url = urlparse . urljoin ( self . base_link , result ) #NEWLINE# url = client . source ( url , output = 'geturl' ) #NEWLINE# if ( not ( 'google' in url ) ) : #NEWLINE# #INDENT# raise Exception ( ) #NEWLINE# #UNINDENT# url = url . split ( 'get_video_info' ) [ 0 ] #NEWLINE# url = resolvers . request ( url ) #NEWLINE# for i in url : #NEWLINE# #INDENT# sources . append ( { #NEWLINE# #INDENT# 'source' : 'GVideo' , #NEWLINE# 'quality' : i [ 'quality' ] , #NEWLINE# 'provider' : 'MVsnap' , #NEWLINE# 'url' : i [ 'url' ] , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# return sources #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return sources