mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 18:36:44 +00:00
Small bugfix
This commit is contained in:
parent
54b4d2d5b4
commit
cadaf14c1b
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user