#NEWLINE# def play( self , stream , cmd = [ 'livestreamer' ] ) : #NEWLINE# #INDENT# full_cmd = list ( cmd ) #NEWLINE# for k in stream . keys ( ) : #NEWLINE# #INDENT# for ( i , arg ) in enumerate ( full_cmd ) : #NEWLINE# #INDENT# if ( k == 'seen' ) : #NEWLINE# #INDENT# key = 'views' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# key = k #NEWLINE# #UNINDENT# full_cmd [ i ] = arg . replace ( ( ( '{{' + key ) + '}}' ) , stream [ k ] . __str__ ( ) ) #NEWLINE# #UNINDENT# #UNINDENT# full_cmd . extend ( [ stream [ 'url' ] , stream [ 'res' ] ] ) #NEWLINE# return Popen ( full_cmd , stdout = PIPE , stderr = STDOUT )