Changed path for cookie (/facebook no longer wd)

pull/5/head
Lasse Edfast 5 years ago
parent 253a229ae9
commit 033875323c
  1. 4
      facebook/helpers.py

@ -14,6 +14,7 @@ def sleep_(t):
sleep(t * variation * random.randrange(85, 115, 1) / 100) sleep(t * variation * random.randrange(85, 115, 1) / 100)
if random.randrange(0, 60, 1) == 1: if random.randrange(0, 60, 1) == 1:
longsleep = random.randrange(200, 300) longsleep = random.randrange(200, 300)
print('')
for s in range(0, longsleep): for s in range(0, longsleep):
print(f"Sover {longsleep - s} sekunder till... ", end="\r") print(f"Sover {longsleep - s} sekunder till... ", end="\r")
sleep(1) sleep(1)
@ -23,7 +24,7 @@ def sleep_(t):
# TODO #1 spara cookies till db # TODO #1 spara cookies till db
def update_cookie(cookies, profile_name): def update_cookie(cookies, profile_name):
""" Uppdaterar cookie för browser """ """ Uppdaterar cookie för browser """
with open("../data/cookie_{}.pkl".format(profile_name), "wb") as f: with open("data/cookie_{}.pkl".format(profile_name), "wb") as f:
pickle.dump(cookies, f) pickle.dump(cookies, f)
@ -71,3 +72,4 @@ def write_error(nr, e="", traceback="", soup="", user="", url="", url_name=""):
) )
except Exception as e: except Exception as e:
print(e) print(e)

Loading…
Cancel
Save