mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2025-02-17 05:48:24 +00:00
config.py: update function exclude_blacklisted(links)
This commit is contained in:
parent
a3705e31c6
commit
8502fa5cc3
1 changed files with 11 additions and 12 deletions
|
@ -37,7 +37,7 @@ def validate_links(links):
|
||||||
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
|
||||||
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
|
||||||
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
links = sorted_links(links) # deterministically sort the links based on timstamp, url
|
||||||
links = exclude_links(links) # exclude links that are in blacklist
|
links = list(exclude_links(links)) # exclude URLs that match the blacklisted url pattern regex
|
||||||
|
|
||||||
if not links:
|
if not links:
|
||||||
print('[X] No links found :(')
|
print('[X] No links found :(')
|
||||||
|
@ -120,9 +120,8 @@ def lowest_uniq_timestamp(used_timestamps, timestamp):
|
||||||
|
|
||||||
return new_timestamp
|
return new_timestamp
|
||||||
|
|
||||||
def exclude_links(links):
|
def exclude_blacklisted(links):
|
||||||
"""exclude links that are in blacklist"""
|
"""exclude URLs that match the blacklisted url pattern regex"""
|
||||||
|
return (link for link in links if not URL_BLACKLIST.match(link['url']))
|
||||||
|
|
||||||
links = [link for link in links if not URL_BLACKLIST.match(link['url'])]
|
|
||||||
|
|
||||||
return links
|
|
Loading…
Add table
Reference in a new issue