Update wrapper.py

This commit is contained in:
akamhy 2020-05-07 17:25:34 +05:30 committed by GitHub
parent afded51a04
commit 0c4f119981
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,9 +88,13 @@ def get(url, encoding=None, UA=default_UA):
return resp.read().decode(encoding.replace("text/html", "UTF-8", 1)) return resp.read().decode(encoding.replace("text/html", "UTF-8", 1))
def near(**kwargs): def near(url, **kwargs):
try:
url = kwargs["url"] url = kwargs["url"]
except KeyError:
url = url
year=kwargs.get("year", datetime.utcnow().strftime('%Y')) year=kwargs.get("year", datetime.utcnow().strftime('%Y'))
month=kwargs.get("month", datetime.utcnow().strftime('%m')) month=kwargs.get("month", datetime.utcnow().strftime('%m'))
day=kwargs.get("day", datetime.utcnow().strftime('%d')) day=kwargs.get("day", datetime.utcnow().strftime('%d'))