def get(self, bookmark, url, accept_charset=False, use_proxy=False):
if url.startswith('ftp://'):
- error, _, _, body = asyncio.run(get_ftp(
+ error, body = asyncio.run(_get_ftp(
url, connect_timeout=self.connect_timeout,
timeout=self.timeout,
))
return e, None, None, None
-async def get_ftp(url, connect_timeout=30, timeout=60):
+async def _get_ftp(url, connect_timeout=30, timeout=60):
split_results = urlsplit(url)
path = split_results.path or '/'
user = split_results.username or 'anonymous'
async for _path, _info in client.list(path, recursive=True):
lines.append('%s %s' % (_info, _path))
except (OSError, aioftp.errors.AIOFTPException) as e:
- return e, None, None, None
- return None, None, None, '\n'.join(lines)
+ return e, None
+ return None, '\n'.join(lines)