From 17273a1f8da4153893601e0fa6132816d5ea03bb Mon Sep 17 00:00:00 2001 From: Sunpy Date: Tue, 15 May 2018 11:27:07 +0200 Subject: [PATCH] Fixed scrape sql query --- scrape.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scrape.py b/scrape.py index de1d9ac..e5d48bf 100644 --- a/scrape.py +++ b/scrape.py @@ -3,7 +3,7 @@ import urllib.request, json import MySQLdb import MySQLdb.cursors -import time +import time, calendar import atexit finished = False @@ -44,12 +44,12 @@ while not finished: data["filename"], data["file_hash"], data["filesize"], - data["timestamp"], + calendar.timegm(time.strptime(data["timestamp"], "%Y-%m-%d %H:%M:%S")), data["patch_id"], data["url_full"], data["url_patch"] - ] - ) + ]) + sql.commit() completed = True failed_streak = 0 print("target: {}, status: OK".format(target))