Small bugfix

This commit is contained in:
Simon 2018-08-23 12:12:23 -04:00
parent 54b4d2d5b4
commit cadaf14c1b

View File

@ -119,7 +119,6 @@ class HttpDirectory(RemoteDirectory):
return curl_head return curl_head
def list_dir(self, path): def list_dir(self, path):
current_dir_name = path[path.rstrip("/").rfind("/") + 1: -1] current_dir_name = path[path.rstrip("/").rfind("/") + 1: -1]
@ -235,14 +234,14 @@ class HttpDirectory(RemoteDirectory):
@staticmethod @staticmethod
def _should_ignore(base_url, current_path, link: Anchor): def _should_ignore(base_url, current_path, link: Anchor):
if urljoin(base_url, link.href) == urljoin(urljoin(base_url, current_path), "../"): full_url = urljoin(base_url, link.href)
if full_url == urljoin(urljoin(base_url, current_path), "../") or full_url == base_url:
return True return True
if link.href.endswith(HttpDirectory.BLACK_LIST): if link.href.endswith(HttpDirectory.BLACK_LIST):
return True return True
# Ignore external links # Ignore external links
full_url = urljoin(base_url, link.href)
if not full_url.startswith(base_url): if not full_url.startswith(base_url):
return True return True