1
0
Fork 0
mirror of synced 2024-09-30 17:17:12 +13:00

config.py: update function exclude_blacklisted(links)

This commit is contained in:
mlazana 2019-03-27 20:10:05 +02:00
parent a3705e31c6
commit 8502fa5cc3

View file

@ -34,10 +34,10 @@ from config import (
def validate_links(links):
check_links_structure(links)
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
links = sorted_links(links) # deterministically sort the links based on timstamp, url
links = exclude_links(links) # exclude links that are in blacklist
links = archivable_links(links) # remove chrome://, about:, mailto: etc.
links = uniquefied_links(links) # merge/dedupe duplicate timestamps & urls
links = sorted_links(links) # deterministically sort the links based on timstamp, url
links = list(exclude_links(links)) # exclude URLs that match the blacklisted url pattern regex
if not links:
print('[X] No links found :(')
@ -120,9 +120,8 @@ def lowest_uniq_timestamp(used_timestamps, timestamp):
return new_timestamp
def exclude_links(links):
"""exclude links that are in blacklist"""
def exclude_blacklisted(links):
"""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