diff --git a/hnarchive.py b/hnarchive.py index 9c9b9cc..ea81969 100644 --- a/hnarchive.py +++ b/hnarchive.py @@ -20,6 +20,9 @@ HEADERS = { 'User-Agent': f'voussoir/hnarchive v{VERSION}.', } +session = requests.Session() +session.headers.update(HEADERS) + DB_INIT = ''' PRAGMA user_version = 1; CREATE TABLE IF NOT EXISTS items( @@ -67,9 +70,6 @@ def int_or_none(x): # API ############################################################################################## -session = requests.Session() -session.headers.update(HEADERS) - def get(url, retries=1): start_time = time.time()