• 党建一键学习


    # author: ya0guang
    
    import requests
    import time
    
    # fill in this pls!
    sessionID = "你的sessionid"
    
    # 这里填写课程的classid
    courseID = 1252
    ccID = 753
    classID = 56
    watchTime = 120
    
    #courseList: (courseID, ccID) 这里填写每个视频的courseid和ccid
    courseList = {(1263, 758), (1270, 760), (1279,762), (1280, 763), (1281, 764), 
                  (1282, 765), (1283, 766)}
                  
    postData = {"courseID": courseID, "watchTime": watchTime, "ccID": ccID, "classID": classID}
    
    headers = {"Host": "xjtudj.edu.cn", 
              "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
              "Accept": "application/json, text/javascript, */*; q=0.01", 
              "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", 
              "Accept-Encoding": "gzip, deflate", 
              "Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7"}
    cookie = {'route': '', "JSESSIONID": sessionID}
    url = "http://xjtudj.edu.cn/course/course_updateUserWatchRecord.do"
    
    for course in courseList:
        (courseID, ccID) = course
        print(course)
        for watchTime in range(0, 12000, 60): # 对于一些时间长的课程,这里设置合适的时间(此处为12000秒)
            postData = {"courseID": courseID, "watchTime": watchTime, "ccID": ccID, "classID": classID}
            r = requests.post(url,data=postData, cookies=cookie, headers=headers)
            time.sleep(0.1)
            print(course, r.text)
  • 相关阅读:
    webmagic的使用学习
    redis在macOS上的安装及与springboot的整合使用
    Swagger-UI
    个人作业——软件工程实践总结&个人技术博客
    祝贺大野鸡喜提小黄衫一件
    软件评测(个人作业)
    结对第二次作业
    Springboot项目创建文件中相对路径问题
    二进制翻转
    欧拉降幂及广义欧拉降幂证明
  • 原文地址:https://www.cnblogs.com/zealousness/p/9615955.html
Copyright © 2020-2023  润新知