mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-05-16 08:04:26 -04:00
fix a bunch of mypy errors
This commit is contained in:
parent
03ed5d668b
commit
f4e018ba0c
3 changed files with 53 additions and 43 deletions
|
@ -8,7 +8,7 @@ from .util import (
|
|||
merge_links,
|
||||
)
|
||||
|
||||
from .config import URL_BLACKLIST
|
||||
from .config import URL_BLACKLIST_PTN
|
||||
|
||||
|
||||
def validate_links(links: Iterable[Link]) -> Iterable[Link]:
|
||||
|
@ -26,7 +26,7 @@ def archivable_links(links: Iterable[Link]) -> Iterable[Link]:
|
|||
"""remove chrome://, about:// or other schemed links that cant be archived"""
|
||||
for link in links:
|
||||
scheme_is_valid = scheme(link.url) in ('http', 'https', 'ftp')
|
||||
not_blacklisted = (not URL_BLACKLIST.match(link.url)) if URL_BLACKLIST else True
|
||||
not_blacklisted = (not URL_BLACKLIST_PTN.match(link.url)) if URL_BLACKLIST_PTN else True
|
||||
if scheme_is_valid and not_blacklisted:
|
||||
yield link
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue