Commit 3da83a22 by lichenggang

获得corestaff正确的token

parent 73f224f8
Showing with 20 additions and 2 deletions
......@@ -6,6 +6,7 @@ import traceback
from requests import sessions
import token_lib
from utils.proxy_util import proxies
PLATFORM = "corestaff"
LEVEL = "H"
......@@ -40,8 +41,8 @@ class DGTokenCrawler(token_lib.BaseTokenCrawler):
while 1:
try:
with sessions.Session() as session:
one = session.request('GET', url, headers=headers, timeout=10)
two = session.request('GET', url, headers=headers, timeout=10)
one = session.request('GET', url, headers=headers, proxies=proxies, timeout=10)
two = session.request('GET', url, headers=headers, proxies=proxies, timeout=10)
if two.status_code == 200:
jes = one.cookies.get('JSESSIONID')
token.append(jes)
......
#!/usr/bin/env python
# -*- coding:utf-8 -*-
proxyHost = "http-proxy-t3.dobel.cn"
proxyPort = "9180"
proxyUser = "LIEXINHTT1"
proxyPass = "oK97IIl298"
proxyMeta = "http://%(user)s:%(pass)s@%(host)s:%(port)s" % {
"host": proxyHost,
"port": proxyPort,
"user": proxyUser,
"pass": proxyPass,
}
proxies = {
"http": proxyMeta,
"https": proxyMeta,
}
\ No newline at end of file
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 sign in to comment