#NEWLINE# def get( self ) : #NEWLINE# #INDENT# data = self . get_urldata ( ) #NEWLINE# if self . exclude ( url . options ) : #NEWLINE# #INDENT# ( yield ServiceError ( 'Excluding video' ) ) #NEWLINE# return #NEWLINE# #UNINDENT# match = re . search ( '="(http://www.expressen.se/tvspelare[^"]+)"' , data ) #NEWLINE# if ( not match ) : #NEWLINE# #INDENT# log . error ( "Can't find video id" ) #NEWLINE# return #NEWLINE# #UNINDENT# url = decode_html_entities ( match . group ( 1 ) ) #NEWLINE# data = self . http . request ( 'get' , url ) #NEWLINE# match = re . search ( 'window.Player.settings = ({.*});' , data . text ) #NEWLINE# if ( not match ) : #NEWLINE# #INDENT# log . error ( "Can't find json info." ) #NEWLINE# #UNINDENT# dataj = json . loads ( match . group ( 1 ) ) #NEWLINE# if ( 'streams' in dataj ) : #NEWLINE# #INDENT# if ( 'iPad' in dataj [ 'streams' ] ) : #NEWLINE# #INDENT# streams = hlsparse ( self . options , self . http . request ( 'get' , dataj [ 'streams' ] [ 'iPad' ] ) , dataj [ 'streams' ] [ 'iPad' ] ) #NEWLINE# for n in list ( streams . keys ( ) ) : #NEWLINE# #INDENT# ( yield streams [ n ] ) #NEWLINE# #UNINDENT# #UNINDENT# if ( 'hashHls' in dataj [ 'streams' ] ) : #NEWLINE# #INDENT# streams = hlsparse ( self . options , self . http . request ( 'get' , dataj [ 'streams' ] [ 'hashHls' ] ) , dataj [ 'streams' ] [ 'hashHls' ] ) #NEWLINE# for n in list ( streams . keys ( ) ) : #NEWLINE# #INDENT# ( yield streams [ n ] )