Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions update-zonefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

import requests
from pathlib import Path
from datetime import datetime
from datetime import datetime, timezone
import email.utils as eut
import os
import hashlib
Expand Down Expand Up @@ -67,7 +67,7 @@ def download_list(url):
cache = Path(config['cache'], hashlib.sha1(url.encode()).hexdigest())

if cache.is_file():
last_modified = datetime.utcfromtimestamp(cache.stat().st_mtime)
last_modified = datetime.fromtimestamp(cache.stat().st_mtime, tz=timezone.utc)
headers = {
'If-modified-since': eut.format_datetime(last_modified),
'User-Agent': 'Bind adblock zonfile updater v1.0 (https://github.com/Trellmor/bind-adblock)'
Expand Down