Commit 8809504d authored by lixiaofang's avatar lixiaofang

ad

parent 5b89b140
import requests import requests
import traceback import traceback
import logging import logging
<<<<<<< HEAD
import json import json
=======
>>>>>>> sentry
from libs.cache import redis_client from libs.cache import redis_client
login_url = "http://earth.iyanzhi.com/api/account/login_pwd" login_url = "http://earth.iyanzhi.com/api/account/login_pwd"
...@@ -26,10 +23,8 @@ def get_cook(): ...@@ -26,10 +23,8 @@ def get_cook():
data = open("/srv/apps/physical/vest/data/vest_user_email.txt") data = open("/srv/apps/physical/vest/data/vest_user_email.txt")
list = [] list = []
dicts = {} dicts = {}
for i in data: for i in data:
list.append(i.strip('\n').strip(',')) list.append(i.strip('\n').strip(','))
for i in list: for i in list:
cookies = index_first() cookies = index_first()
post_dict = { post_dict = {
...@@ -43,18 +38,13 @@ def get_cook(): ...@@ -43,18 +38,13 @@ def get_cook():
cookies=cookies cookies=cookies
) )
headers = response.headers headers = response.headers
print(response.text)
cook = headers['Set-Cookie'].split(";") cook = headers['Set-Cookie'].split(";")
cook = cook[0].split('=')[1] cook = cook[0].split('=')[1]
logging.info("response.text :%s" % response.text) logging.info("response.text :%s" % response.text)
dicts[i] = cook dicts[i] = cook
return dicts return dicts
except: except:
logging.error("index_first:%s" % traceback.format_exc()) logging.error("index_first:%s" % traceback.format_exc())
return None return None
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment