Created
January 15, 2020 06:05
-
-
Save leoleoasd/4e33501b1a46dbe53a88791f6300d137 to your computer and use it in GitHub Desktop.
新生安全教育刷课脚本
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--coding:utf-8-- | |
import requests | |
import time | |
userProjectId = '' | |
tenantCode = '' | |
userId = '' | |
token = '' | |
resp = requests.post("https://weiban.mycourse.cn/pharos/usercourse/listCourse.do?timestamp={}".format(int(time.time())), | |
data={ | |
'userProjectId': userProjectId, | |
'tenantCode' : tenantCode, | |
'userId': userId, | |
'token' : token, | |
'chooseType': 3, | |
'name': "" | |
}) | |
#print(resp.json()) | |
test = [i for j in resp.json()['data'] for i in j['courseList']] | |
flag = False | |
for i in test: | |
if i['finished'] == 1: continue | |
print(i['resourceName']) | |
uuid = i['userCourseId'] | |
print(uuid) | |
tennantCode = "12200001" | |
ti = int(time.time() * 1000) | |
ass = requests.post("https://weiban.mycourse.cn/pharos/usercourse/study.do?timestamp={}".format(int(time.time())), | |
data ={ | |
'userProjectId': userProjectId, | |
'tenantCode' : tenantCode, | |
'userId': userId, | |
'token' : token, | |
'courseId': i['resourceId'], | |
}) | |
ass = requests.post("https://weiban.mycourse.cn/pharos/usercourse/getCourseUrl.do?timestamp={}".format(int(time.time())), | |
data ={ | |
'userProjectId': userProjectId, | |
'tenantCode' : tenantCode, | |
'userId': userId, | |
'token' : token, | |
'courseId': i['resourceId'], | |
}) | |
a = requests.get( | |
"https://weiban.mycourse.cn/pharos/usercourse/finish.do?callback=jQuery164032323733082721273_1579067538095&userCourseId={}&tenantCode={}&_={}". | |
format(uuid, tennantCode, ti), | |
verify=False) | |
print(a.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment