Skip to content

Commit

Permalink
去除util中不再需要的get_session方法
Browse files Browse the repository at this point in the history
  • Loading branch information
huanghyw committed Dec 22, 2020
1 parent 7670886 commit 359fe4f
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions util.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,6 @@ def get_random_useragent():
return random.choice(USER_AGENTS)


def get_session():
# 初始化session
session = requests.session()
session.headers = {"User-Agent": global_config.getRaw('config', 'DEFAULT_USER_AGENT'),
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
"Connection": "keep-alive"}
# checksession = requests.session()
# checksession.headers = {"User-Agent": global_config.getRaw('config', 'DEFAULT_USER_AGENT'),
# "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3",
# "Connection": "keep-alive"}
# 获取cookies保存到session
# session.cookies = get_cookies()
return session


def wait_some_time():
time.sleep(random.randint(100, 300) / 1000)

Expand Down

0 comments on commit 359fe4f

Please sign in to comment.