• 大小: 5KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-06-15
  • 语言: Python
  • 标签: 爬虫  

资源简介

浙江线上大学刷课脚本,****************************************************************************

资源截图

代码片段和文件信息

# -*- coding=utf-8 -*-
import requests
import urllib.parse
import json
import time
from moviepy.editor import VideoFileClip
lvt=str(int(time.time()))
lvpt=str(int(time.time())+70)
getprofile=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/student/system/getProfile‘
getunitdetial=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/teacher/course/plan/unit/getDetail‘
getinfo=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/common/ccPlayer/getInfo‘
listurl=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/student/course/system/list‘
sessionlist=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/student/course/plan/list‘
loginurl=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/student/system/login‘
upurl=‘http://student.zjedu.moocollege.com/nodeapi/3.0.1/student/course/uploadLearnRate‘
listrequest=‘{“status“: ““ “search“: ““ “current“: 1 “pageSize“: 12}‘
def headers(tokenrealnameavatar):
headers={
‘Accept‘:‘*/*‘
‘Accept-Encoding‘:‘gzip deflate‘
‘Accept-Language‘:‘zh-CNzh;q=0.9en-GB;q=0.8en;q=0.7‘
‘Content-Length‘:‘97‘
‘Content-Type‘:‘application/json‘
‘Cookie‘:‘NOISSESUDEJZXJ=s%3AwBhkXjYw8eZVmKQxEGZC6Y7MKwbeHvbA.hnigrPSAapNR1AEraLjYJhPnjhwqje8UrwL8pIyBAEU; Hm_lvt_70a5d649dfa86aee3afdc28e95ee2c41=‘+lvt+‘; Hm_lpvt_70a5d649dfa86aee3afdc28e95ee2c41=‘+lvpt+‘; token-student-zjedu=‘+token+‘; realname-student-zjedu=‘+realname+‘; avatar-student-zjedu=‘+avatar
‘DNT‘:‘1‘
‘Host‘:‘student.zjedu.moocollege.com‘
‘Origin‘:‘http://student.zjedu.moocollege.com‘
‘Referer‘:‘http://student.zjedu.moocollege.com/system/login‘
‘User-Agent‘:‘Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML like Gecko) Chrome/66.0.3355.4 Safari/537.36‘
}
return headers
def cookiesmaker(tokenrealnameavatar):

token=urllib.parse.quote(‘“‘+token+‘“‘)
realname=urllib.parse.quote(‘“‘+realname+‘“‘)
if avatar!=‘null‘ or avatar!=‘None‘:
avatar = urllib.parse.quote(‘“‘ + str(avatar) + ‘“‘)
# cookies=‘NOISSESUDEJZXJ=s%3AwBhkXjYw8eZVmKQxEGZC6Y7MKwbeHvbA.hnigrPSAapNR1AEraLjYJhPnjhwqje8UrwL8pIyBAEU; Hm_lvt_70a5d649dfa86aee3afdc28e95ee2c41=‘+lvt+‘; Hm_lpvt_70a5d649dfa86aee3afdc28e95ee2c41=‘+lvpt+‘; token-student-zjedu=‘+token+‘; realname-student-zjedu=‘+realname+‘; avatar-student-zjedu=‘+avatar
return headers(tokenrealnameavatar)

if __name__ == ‘__main__‘:
session=requests.session()
session.headers = headers(‘““‘‘““‘‘““‘)
while True:
username=str(input(‘请输入学号,回车结束:  ——>‘))
password=str(input(‘请输入密码,回车结束: ——>‘))
# username=‘‘
# password = ‘‘

userdata=json.loads(‘{“orgId“: 64 “username“: “‘+ username+‘“ “password“: “‘+password+‘“ “type“: “studentNo“ “rememberMe“: false}‘)
print

评论

共有 条评论