def search_exact(name='', have_path=False): buf = BytesIO() # need to unquote for LIST to work properly with nocwd name = urllib.parse.unquote(name) path = _util.create_nwo_path(name) if not have_path else '' c = _curl.curl_common_init(buf) #c.setopt(c.DIRLISTONLY, True) c.setopt(c.USE_SSL, True) c.setopt(c.SSL_VERIFYPEER, False) c.setopt(c.USERPWD, '{}:{}'.format(loc['USER'], loc['PASS'])) c.setopt(c.PORT, loc['FTPPORT']) ml = loc['MLOC'] if not have_path else '' path_noscheme = '{}{}{}/{}/'.format(loc['DOMAIN'], ml, path, name) _g.log.info('ftp://' + path_noscheme) return _curl.curl_to_buf('ftp://' + path_noscheme, 'FTP', c, buf)
def search_query(name=''): return _curl.curl_to_buf('https://{}{}{}'.format(loc['DOMAIN'], loc['SEARCH'], name), 'HTTP')