抱歉import requests
import json
headers = {
'cache-control': 'no-cache',
'accept': 'application/json, text/plain, */*; q=0.01',
'content-type': 'application/json;charset=utf-8',
'cookie': '_ga=GA1.2.1232791235.1560919095; G_ENABLED_IDPS=google; _fbp=fb.1.1560919111593.2093970008; UserDidVisitApp=true; __cfduid=dce5092d9271875c09a8b3e9f73cac0f11570075385; tatari-session-cookie=690d0e2c-0fbf-ef35-2487-8498d30ea678; d7s_uid=k9l9yyrdxonmmq; tatari-cookie-test=26184446; stc117823=env:1588256264%7C20200531141744%7C20200430144744%7C1%7C1073241:20210430141744|uid:1565917487242.1073637811.2107635.117823.779348737.:20210430141744|srchist:1073241%3A1588256264%3A20200531141744:20210430141744|tsa:1588256264963.238488725.49476194.430271162756376.8:20200430144744; _gaexp=GAX1.2.MYMMPqR8QfGrxDn3HtIglg.18508.0; _gid=GA1.2.1430836992.1594873661; puntCookie=true; __zlcmid=zDjHsiZOWFKFSb; tnExp%3AfilteringExperiment2=0; tnExp%3Av3DeviceExperiment2=0; __ssid=a0aa129aa072111096ed1d407ad5c38; FirehoseSession-messaging=true; language=zh; cxz.kerviaNotifPermissionsGranted=true; XSRF-TOKEN=aamnWtsV-86RLjkVaVqz9bcoODC1kurw-50M',
'origin': 'https://www.textnow.com',
'accept-encoding': 'gzip, deflate, br',
'accept-language': 'zh-CN,zh;q=0.9;zh',
'Connection':'keep-alive',
#'x-tn-captcha-v3':'03AGdBq25djUkzVxhpuSoWIo-TmMgB2yjQEjJfulxb7b16lRdyL2nzlXYYgSHDFRsOha0v0WWcgja-5hqI__3PVbr-lWC1gSgG76rLPXN2lDBfkha8auuGAftB0G9MWmptRkXGm1Zf_HZwNcijsIdOWpHSoGi2PM02NJbTJJddazscgrwyCjbrEneXzFGx3LwFQzbDMOYVqB6qOJo9moAPx7wtEQujeP7v8Xi9Xv3EqPr_HTuaoGt0t96o48xQ2UIchCg2SdkzbPnZLr4EkNJIlOARlP0wTmWThAWs4GHbvIbJCLocCHqgTvqiKNwATXnxq3zfgPMIQRw3KdBf5ES3Ze7bL24N89NUiPED25fzJiz0pZTgAre_ITBmDF5fQXD6rlZq7_5KFwbF',
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36',
#'x-csrf-token': 'rb5QMkbZ-HSa0lMSf4xnPQkX981Yyv9rQvQE',
#'x-requested-with': 'XMLHttpRequest',
}
s = requests.session()
s.headers.update(headers)
# s.get('https://www.textnow.com/api/location')
# s.get('https://www.textnow.com/api/client-features/version')
# s.get('https://www.textnow.com/api/client-features/features')
# s.get('https://www.facebook.com/x/oauth/status?client_id=134162068005&input_token&origin=1&redirect_uri=https://www.textnow.com/login&sdk=joey&wants_cookie_data=true', proxies=proxy)
#s.post('https://www.google.com/recaptcha/api2/reload?k=6Ld5K0IUAAAAABGVv54NtC-G_0ygR8vF1rTrwLj2')
resp = s.get('http://www.textnow.com/login')
# print(resp.content.decode('ISO-8859-1'))
# print(s.headers)
# print(s.cookies)
url_1 = 'https://www.textnow.com/api/sessions'
data = {
"json":{
"remember": False,
"username":"保密",
"password":"保密"
}
}
# print(json.dumps(data))
resp = s.post(url_1, data=json.dumps(data))
print(resp.text)
s.close()
|