fix support for IP addresses
This commit is contained in:
@@ -1,13 +1,13 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import tld
|
|
||||||
import json
|
import json
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
def host(string):
|
def host(string):
|
||||||
if string and '*' not in string:
|
if string and '*' not in string:
|
||||||
return tld.get_fld(string, fix_protocol=True, fail_silently=True)
|
return urlparse(string).netloc
|
||||||
|
|
||||||
|
|
||||||
def load_json(file):
|
def load_json(file):
|
||||||
|
|||||||
Reference in New Issue
Block a user