def _url_to_local_path(url, path):
 destination = urllib.parse.urlparse(url).path
 if ((len(destination) < 2) or (destination[0] != '/')):
  raise ValueError('Invalid URL')
 destination = os.path.join(path, urllib.request.url2pathname(destination)[1:])
 return destination

def _url_to_local_path ( url , path ) : destination = urllib . parse . urlparse ( url ) . path if ( ( len ( destination ) < 2 ) or ( destination [ 0 ] != '/' ) ) : raise ValueError ( 'Invalid URL' ) destination = os . path . join ( path , urllib . request . url2pathname ( destination ) [ 1 : ] ) return destination
mirror a url path in a local destination .