#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# content = re . compile ( '(.+?)\\?S\\d*E\\d*$' ) . findall ( url ) #NEWLINE# try : #NEWLINE# #INDENT# ( url , season , episode ) = re . compile ( '(.+?)\\?S(\\d*)E(\\d*)$' ) . findall ( url ) [ 0 ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . base_link = random . choice ( [ self . base_link_1 , self . base_link_2 ] ) #NEWLINE# post_id = re . compile ( '/.+?/(.+)' ) . findall ( url ) [ 0 ] . rsplit ( '/' ) [ 0 ] #NEWLINE# player = urlparse . urljoin ( self . base_link , self . player_link ) #NEWLINE# if ( len ( content ) == 0 ) : #NEWLINE# #INDENT# post = ( self . player_post_1 % post_id ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# post = client . source ( player , post = ( self . player_post_2 % post_id ) , headers = self . headers ) #NEWLINE# post = client . parseDOM ( post , 'ul' , attrs = { #NEWLINE# #INDENT# 'class' : 'movie-parts' , #NEWLINE# #UNINDENT# } ) [ 0 ] #NEWLINE# post = client . parseDOM ( post , 'li' ) #NEWLINE# post = [ ( client . parseDOM ( i , 'a' , ret = 'href' ) , client . parseDOM ( i , 'a' ) ) for i in post ] #NEWLINE# post = [ ( i [ 0 ] [ 0 ] , i [ 1 ] [ 0 ] ) for i in post if ( ( len ( i [ 0 ] ) > 0 ) and ( len ( i [ 1 ] ) > 0 ) ) ] #NEWLINE# post = [ i [ 0 ] for i in post if ( ( '%01d' % int ( episode ) ) == i [ 1 ] ) ] [ 0 ] #NEWLINE# post = urlparse . parse_qs ( urlparse . urlparse ( post ) . query ) [ 'part_id' ] [ 0 ] #NEWLINE# post = ( self . player_post_3 % ( post_id , post ) ) #NEWLINE# #UNINDENT# url = client . source ( player , post = post , headers = self . headers ) #NEWLINE# url = re . compile ( '<source\\s+src="([^"]+)' ) . findall ( url ) [ 0 ] #NEWLINE# url = client . replaceHTMLCodes ( url ) #NEWLINE# if ( 'google' in url ) : #NEWLINE# #INDENT# quality = googleplus . tag ( url ) [ 0 ] [ 'quality' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# quality = 'HD' #NEWLINE# #UNINDENT# sources . append ( { #NEWLINE# #INDENT# 'source' : 'GVideo' , #NEWLINE# 'quality' : quality , #NEWLINE# 'provider' : 'Xmovies' , #NEWLINE# 'url' : url , #NEWLINE# #UNINDENT# } ) #NEWLINE# return sources #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# return sources