Files
Corsy/core/utils.py

12 lines
230 B
Python
Raw Normal View History

2019-11-24 21:12:10 +05:30
import tld
import json
def host(string):
2019-12-04 14:04:03 +08:00
if string and '*' not in string:
return tld.get_fld(string, fix_protocol=True, fail_silently=True)
2019-11-24 21:12:10 +05:30
def load_json(file):
2019-12-04 14:04:03 +08:00
with open(file) as f:
return json.load(f)