#NEWLINE# def download_request( self , request , spider ) : #NEWLINE# #INDENT# p = urlparse_cached ( request ) #NEWLINE# scheme = ( 'https' if request . meta . get ( 'is_secure' ) else 'http' ) #NEWLINE# bucket = p . hostname #NEWLINE# path = ( ( ( p . path + '?' ) + p . query ) if p . query else path . path ) #NEWLINE# url = ( '%s://%s.s3.amazonaws.com%s' % ( scheme , bucket , path ) ) #NEWLINE# signed_headers = self . conn . make_request ( method = request . method , bucket = bucket , key = p . path , query_args = p . query , headers = request . headers , data = request . body ) #NEWLINE# httpreq = request . replace ( url = url , headers = signed_headers ) #NEWLINE# return self . _download_http ( httpreq , spider )