#NEWLINE# def download_subtitle( self , subtitle ) : #NEWLINE# #INDENT# logger . info ( 'Downloading subtitle %r' , subtitle ) #NEWLINE# r = self . session . get ( ( ( self . server_url + subtitle . pid ) + '/download' ) , params = { #NEWLINE# #INDENT# 'container' : 'zip' , #NEWLINE# #UNINDENT# } , timeout = 10 ) #NEWLINE# r . raise_for_status ( ) #NEWLINE# with ZipFile ( io . BytesIO ( r . content ) ) as zf : #NEWLINE# #INDENT# if ( len ( zf . namelist ( ) ) > 1 ) : #NEWLINE# #INDENT# raise ProviderError ( 'More than one file to unzip' ) #NEWLINE# #UNINDENT# subtitle . content = fix_line_ending ( zf . read ( zf . namelist ( ) [ 0 ] ) )