#NEWLINE# def _get_live_streams( self , params , swf_url ) : #NEWLINE# #INDENT# for ( key , quality ) in QUALITY_MAP . items ( ) : #NEWLINE# #INDENT# key_url = '{0}URL' . format ( key ) #NEWLINE# url = params . get ( key_url ) #NEWLINE# if ( not url ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# res = http . get ( url , exception = IOError ) #NEWLINE# #UNINDENT# except IOError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( quality == 'hds' ) : #NEWLINE# #INDENT# streams = HDSStream . parse_manifest ( self . session , res . url ) #NEWLINE# for ( name , stream ) in streams . items ( ) : #NEWLINE# #INDENT# if ( key == 'source' ) : #NEWLINE# #INDENT# name += '+' #NEWLINE# #UNINDENT# ( yield ( swf_url , stream ) ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if res . text . startswith ( 'rtmp' ) : #NEWLINE# #INDENT# match = _rtmp_re . match ( res . text ) #NEWLINE# if ( not match ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# stream = RTMPStream ( self . session , { #NEWLINE# #INDENT# 'rtmp' : match . group ( 'host' ) , #NEWLINE# 'app' : match . group ( 'app' ) , #NEWLINE# 'playpath' : match . group ( 'playpath' ) , #NEWLINE# 'swfVfy' : swf_url , #NEWLINE# 'live' : True , #NEWLINE# #UNINDENT# } ) #NEWLINE# ( yield ( quality , stream ) )