程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

行知学徒网 网课自动刷课时

发布于2020-04-09 19:14     阅读(8833)     评论(5)     点赞(22)     收藏(3)


网站长这个样子
在这里插入图片描述
在这里插入图片描述
网址:https://www.ixueto.com/login.aspx
在这里插入图片描述

完整代码如下

import requests
import json
from lxml import etree
import re

import time


data = {'action': 'ztlesslist',
'jgid': '117',
'ztid': '891',
'page': '1',
'rows': '180'}
text = requests.post('https://www.ixueto.com/ashxV3/jigou.ashx',data=data).content.decode('utf-8')
print(text)
text = json.loads(text)

text = text['content']

tree = etree.HTML(text)
html = tree.xpath('//div[@class="fl-l wid100 kechengmark"]/a/@href')
htm2 = tree.xpath('//div[@class="fl-l wid100 kechengmark"]/a/div/section/text()')


lists = {}
for i in range(len(htm2)):
    a = re.compile(r'\?id=(\d+)')
    allid = a.findall(html[i])


    hour = htm2[i][2:4]
    minute = htm2[i][5:7]
    second = htm2[i][8:10]
    alltimes = int(hour) *60*60 + int(minute)*60 + int(second)
    lists[allid[0]] = alltimes



################################################################

STUUID = '' #填写用户id

IMAGE_BS64_JPEG = ''#填写jpeg格式的照片经过bs64后的数据

URL = '' #填写网址

################################################################


num =0
for i in lists:
    num= num+1

    LESSID = i #视频id
    TIME = lists[i] #观看时间



    #1
    headers = {
      'Referer': 'https://www.ixueto.com/v3/space/jigou_zhuantidetail.aspx?'

    }

    html = requests.get('https://www.ixueto.com/course_study.aspx?id={}{}'.format(LESSID,URL),headers=headers)
    print(html)

    #2
    headers = {
        'Accept': 'application/json, text/javascript, */*; q=0.01',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Length': '56',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',

    }
    data = {'action': 'getCourseTime',
    'lessid': '{}'.format(LESSID), #视频id
    'stuuid': '{}'.format(STUUID),
    'ztid': '891'}
    a = requests.post(url='https://www.ixueto.com/ashx/course.ashx',headers=headers,data=data)
    print(a.text)
    

    #3
    headers = {'Accept': 'application/json, text/javascript, */*; q=0.01',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Length': '45726',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'Host': 'www.ixueto.com',
    'Origin': 'https://www.ixueto.com',
    'Referer': 'https://www.ixueto.com/course_study.aspx?id=12458&luid=U5Ny6uoimrQ=&ztid=891&jgid=117&v=1585471941275',
    'Sec-Fetch-Mode': 'cors',
    'Sec-Fetch-Site': 'same-origin',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',
    'X-Requested-With':'XMLHttpRequest'}
    data ={
        'action': 'ComparePhotoInfo',
        'userId': '{}'.format(STUUID),#用户id
        'src': '{}'.format(IMAGE_BS64_JPEG),
        'cid': '{}'.format(LESSID),#视频id
        'jgpid': '88056',
        'isSave': 'false'
    }
    sa = requests.post(url='https://www.ixueto.com/web/NewAshx/Personal.ashx',headers=headers,data=data)
    print(sa.text)
    


    #4
    headers = {
        'Accept': 'application/json, text/javascript, */*; q=0.01',
    'Accept-Encoding': 'gzip, deflate, br',
    'Accept-Language': 'zh-CN,zh;q=0.9',
    'Connection': 'keep-alive',
    'Content-Length': '56',
    'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36',

    }
    data = {'action': 'updatetimes',
    'lessid': '{}'.format(LESSID), #视频id
     'xxtimes': '{}'.format(TIME), #观看时间
    'stuuid': '{}'.format(STUUID),
    'phone': '1',
    'ztid': '891'}
    a = requests.post(url='https://www.ixueto.com/ashx/course.ashx',headers=headers,data=data)
    print('这是第{}个,还剩{}个'.format(num,int(len(lists))-num)+a.text)
    








STUUID:
f12打开开发者工具,然后如图所示找到stuuid
在这里插入图片描述
IMAGE_BS64_JPEG:
拍一张照片然后把后缀改成.jpeg
进入这个网站:http://tool.chinaz.com/tools/imgtobase/
在这里插入图片描述
把图片转换成base64数据

URL:
进入观看视频页面后复制红圈表示的内容
在这里插入图片描述

运行效果如下
在这里插入图片描述

截至4月7号,本代码无任何问题

原文链接:https://blog.csdn.net/qq_44749634/article/details/105363237



所属网站分类: 技术文章 > 博客

作者:iuie9493

链接:https://www.pythonheidong.com/blog/article/319547/a0b737e5ad30ac764a2a/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

22 0
收藏该文
已收藏
  • #1楼    2021-06-12 20:34:31    17852838992 回复

    现在用不了了

  • #2楼    2021-06-12 20:36:50    17852838992 回复

    显示用户名失效 我把图片转成的base64数据放在txt文件中,然后在python中通过open()打开, 显示存在不安全字符

  • #3楼    2021-10-19 15:48:29    chenpengju 回复

    为什么显示用户名失效呢?

  • #4楼    2021-10-19 16:11:03    chenpengju 回复

    为什么提示用户名失效呢?

  • #5楼    2021-10-19 16:11:35    chenpengju 回复
    @17852838992  2021-06-12 20:36:50

    显示用户名失效 我把图片转成的base64数据放在txt文件中,然后在python中通过open()打开, 显示存在不安全字符

    我也是用户名失效,请问您解决了吗?

评论内容:(最多支持255个字符)