chg: [generator] logging updated

pull/207/head v2.4.153
Alexandre Dulaunoy 2022-02-01 16:52:09 +01:00
parent df73d5c576
commit e72f112dfb
No known key found for this signature in database
GPG Key ID: 09E2CD4944E6CBCD
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,7 @@
beautifulsoup4==4.9.1 beautifulsoup4
pyOpenSSL==19.1.0 pyOpenSSL==19.1.0
python-dateutil==2.8.1 python-dateutil==2.8.1
requests==2.24.0 requests
dnspython dnspython
pyasn1 pyasn1
pyasn1-modules pyasn1-modules

View File

@ -42,6 +42,7 @@ def download_to_file(url, file):
user_agent = { user_agent = {
"User-agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0"} "User-agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0"}
try: try:
logging.info(f'download_to_file - fetching url: {url}')
r = requests.head(url, headers=user_agent) r = requests.head(url, headers=user_agent)
url_datetime = parsedate(r.headers['Last-Modified']).astimezone() url_datetime = parsedate(r.headers['Last-Modified']).astimezone()
file_datetime = datetime.datetime.fromtimestamp( file_datetime = datetime.datetime.fromtimestamp(