绕过蓝墨云进度条拖动限制批量刷视频脚本

绕过蓝墨云进度条拖动限制批量刷视频脚本

摘要: 绕过蓝墨云进度条拖动限制批量刷视频脚本

0x01 写在前面

被通信原理的傻通老师搞烦了,看快一百个视频实在看不完直接写个批量脚本莽吧。

0x02 环境

操作系统:win10 / kali 2019.2

IDE/编辑器:pycharm 2020.1 / sublime

使用工具:python3.6 beautifulsoup4库 requests库

0x03 具体代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# -*- coding: utf-8 -*-
# @Author : Hn13
# @Blog : https://www.hn13.top
import requests
import sys
from requests.packages import urllib3
from bs4 import BeautifulSoup as bs

urllib3.disable_warnings()


def getFileId(cookie):
url = "https://www.mosoteach.cn/web/index.php?c=res&m=index&clazz_course_id=3EBFFBFA-CCAF-11E9-9C7F-98039B1848C6"
cookie = cookie
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,"
"application/signed-exchange;v=b3;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Cookie": cookie,
"Host": "www.mosoteach.cn",
"Referer": "https://www.mosoteach.cn/web/index.php?c=res&m=index&clazz_course_id=3EBFFBFA-CCAF-11E9-9C7F"
"-98039B1848C6",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/86.0.4240.198 Safari/537.36 "
}
r = requests.get(url=url, headers=headers, verify=False)
soup = bs(r.text, features="html.parser")
tag = soup.find_all(name="div", attrs={"class": "res-row-open-enable res-row preview", "data-mime": "video"})
num = 0
resId = []
for v in tag:
resId.append(v['data-value'])
num += 1
if num != 0:
print("Get \033[32m"+str(num)+"\033[0m videos")
return resId
else:
return -1

def postData(cookie, resId):
urlForSaveWatch = "https://www.mosoteach.cn/web/index.php?c=res&m=save_watch_to"
resId = resId
cookie = cookie
headers = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,"
"application/signed-exchange;v=b3;q=0.9",
"Accept-Encoding": "gzip, deflate, br",
"Accept-Language": "zh-CN,zh;q=0.9,zh-TW;q=0.8,en;q=0.7",
"Cache-Control": "max-age=0",
"Connection": "keep-alive",
"Cookie": cookie,
"Host": "www.mosoteach.cn",
"Referer": "https://www.mosoteach.cn/web/index.php?c=res&m=index&clazz_course_id=3EBFFBFA-CCAF-11E9-9C7F"
"-98039B1848C6",
"Sec-Fetch-Dest": "document",
"Sec-Fetch-Mode": "navigate",
"Sec-Fetch-Site": "same-origin",
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) "
"Chrome/86.0.4240.198 Safari/537.36 "
}
data = {
"clazz_course_id": "3EBFFBFA-CCAF-11E9-9C7F-98039B1848C6",
"res_id": resId,
"watch_to": "10000",
"duration": "523",
"current_watch_to": "15"
}
r = requests.post(url=urlForSaveWatch, data=data ,headers=headers, verify=False)
if "success" in r.text:
print("[+] Video: "+resId+" bypass \033[32msuccess!\033[0m")
else:
print("[-] Video: "+resId+" \033[31mfailed!\033[0m")


def main():
if len(sys.argv) == 1:
print("[-] \033[31mFail! Please Enter the cookie\033[0m usage: python3 lanmoyunBypass.py [cookie]")
elif len(sys.argv) > 2:
print("[-] \033[31mFail! Too many argv!\033[0m usage: python3 lanmoyunBypass.py [cookie]")
else:
resIds = getFileId(sys.argv[1])
if resIds == -1:
print("Get videoId \033[31m failed!\033[0m")
else:
for resId in resIds:
postData(cookie=sys.argv[1], resId=resId)


if __name__ == '__main__':
main()

需要事先登录网页F12拿到cookie:

使用方式如下

1
python3 lanmoyunBypass.py [cookie]

0x04 效果


评论