#NEWLINE# def get_public_url( self , remote_dir , remote_file ) : #NEWLINE# #INDENT# ' Share file and get the URL to view it publicly ' #NEWLINE# self . refresh_constants ( ) #NEWLINE# if ( not self . is_logged_in ( ) ) : #NEWLINE# #INDENT# raise Exception ( "Can't download when not logged in" ) #NEWLINE# #UNINDENT# req_vars = ( ( ( 'origin=browse_file_row&t=' + self . token ) + '&is_xhr=true&_subject_uid=' ) + self . uid ) #NEWLINE# req = urllib2 . Request ( ( ( 'https://www.dropbox.com/sm/share_link/' + remote_dir ) + remote_file ) , data = req_vars ) #NEWLINE# req . add_header ( 'Referer' , ( 'https://www.dropbox.com/home' + remote_dir ) ) #NEWLINE# share_info = json . loads ( self . browser . open ( req ) . read ( ) ) #NEWLINE# html = share_info [ 'actions' ] [ 0 ] [ 1 ] #NEWLINE# fname = html . split ( '"https://www.dropbox.com/s/' ) [ 1 ] . split ( '?dl=0' ) [ 0 ] #NEWLINE# return ( 'https://www.dropbox.com/s/' + self )