Actually use publicsuffix2

This commit is contained in:
Sean Whalen
2018-11-26 08:31:32 -05:00
parent be27080e4d
commit f982d870fe
2 changed files with 12 additions and 9 deletions
+10 -7
View File
@@ -2,9 +2,6 @@ language: python
sudo: true
services:
- elasticsearch
python:
- '3.4'
- '3.5'
@@ -12,15 +9,20 @@ python:
# commands to install dependencies
before_install:
- "sudo apt-get install -y apt-transport-https"
- "sudo apt-get update"
- "sudo apt-get install -y libemail-outlook-message-perl"
- "sudo apt-get install -y apt-transport-https systemd"
- "wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -"
- 'echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list'
- "sudo apt-get update"
- "sudo apt-get install -y default-jre-headless elasticsearch"
- "sudo systemctl daemon-reload"
- "sudo systemctl enable elasticsearch.service"
- "sudo service elastsearch start"
install:
- "pip install -r requirements.txt"
before_script:
- sleep 10
# commands to run samples
script:
- "flake8 *.py parsedmarc/*.py"
@@ -29,6 +31,7 @@ script:
- "make html"
- "cd .."
- "python tests.py"
- "python setup.py install"
- "parsedmarc --save-aggregate samples/aggregate/*"
- "parsedmarc --save-forensic samples/forensic/*"
- "python setup.py sdist"
+2 -2
View File
@@ -23,7 +23,7 @@ import dns.exception
import geoip2.database
import geoip2.errors
import requests
import publicsuffix
import publicsuffix2
__version__ = "4.3.9"
@@ -99,7 +99,7 @@ def get_base_domain(domain):
logger.warning(
"Failed to download an updated PSL {0}".format(error))
with open(psl_path, encoding="utf-8") as psl_file:
psl = publicsuffix.PublicSuffixList(psl_file)
psl = publicsuffix2.PublicSuffixList(psl_file)
return psl.get_public_suffix(domain)