mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-25 23:36:22 +02:00
config.py: update function exclude_blacklisted(links)
This commit is contained in:
@@ -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
|
|
Reference in New Issue
Block a user