Skip to content

Commit d4b91b4

Browse files
author
mochazi
committed
2021-12-31 下载小鹅通视频-mitmproxy版本🎉
1 parent 9df8bad commit d4b91b4

File tree

41 files changed

+1094
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1094
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from Crypto.Cipher import AES
2+
3+
# 设置模式
4+
mode = AES.MODE_CBC
5+
6+
key = b'V\x9dH\x1e:\xe6g\x10\x11l\xd7\xab\xd5\xd3\xc1\xbc'
7+
8+
'''
9+
生成解密对象
10+
key:密钥
11+
mode:解密模式
12+
iv:偏移量
13+
'''
14+
cryptos = AES.new(key=key,mode=mode,iv=b'0000000000000000')
15+
16+
with open('before.ts','rb') as f: # 解密前
17+
with open('after.ts','wb') as f2: # 解密后
18+
f2.write(cryptos.decrypt(f.read()))
66.5 KB
Binary file not shown.
66.5 KB
Binary file not shown.
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#EXTM3U
2+
#EXT-X-VERSION:3
3+
#EXT-X-TARGETDURATION:11
4+
#EXT-X-MEDIA-SEQUENCE:0
5+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
6+
#EXTINF:2.000000,
7+
v.f230.ts?start=0&end=68063&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
8+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
9+
#EXTINF:2.000000,
10+
v.f230.ts?start=68064&end=130671&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
11+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
12+
#EXTINF:1.708333,
13+
v.f230.ts?start=130672&end=190847&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
14+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
15+
#EXTINF:2.000000,
16+
v.f230.ts?start=190848&end=281471&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
17+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
18+
#EXTINF:2.000000,
19+
v.f230.ts?start=281472&end=369471&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
20+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
21+
#EXTINF:2.000000,
22+
v.f230.ts?start=369472&end=457647&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
23+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
24+
#EXTINF:2.000000,
25+
v.f230.ts?start=457648&end=742095&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
26+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
27+
#EXTINF:4.291667,
28+
v.f230.ts?start=742096&end=1186719&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
29+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
30+
#EXTINF:4.000000,
31+
v.f230.ts?start=1186720&end=1413087&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
32+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
33+
#EXTINF:4.000000,
34+
v.f230.ts?start=1413088&end=1776687&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
35+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
36+
#EXTINF:5.791667,
37+
v.f230.ts?start=1776688&end=2031631&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
38+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
39+
#EXTINF:6.000000,
40+
v.f230.ts?start=2031632&end=2294271&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
41+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
42+
#EXTINF:6.000000,
43+
v.f230.ts?start=2294272&end=2535679&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
44+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
45+
#EXTINF:10.208333,
46+
v.f230.ts?start=2535680&end=3179583&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
47+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
48+
#EXTINF:9.666667,
49+
v.f230.ts?start=3179584&end=3695279&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
50+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
51+
#EXTINF:10.000000,
52+
v.f230.ts?start=3695280&end=3994207&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
53+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
54+
#EXTINF:10.750000,
55+
v.f230.ts?start=3994208&end=4735695&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
56+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
57+
#EXTINF:9.333333,
58+
v.f230.ts?start=4735696&end=5240671&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
59+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
60+
#EXTINF:9.583333,
61+
v.f230.ts?start=5240672&end=5551439&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
62+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
63+
#EXTINF:10.416667,
64+
v.f230.ts?start=5551440&end=5820671&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
65+
#EXT-X-KEY:METHOD=AES-128,URI="https://app.xiaoe-tech.com/get_video_key.php?edk=CiCHkZwwhEr4uPPu%2FDpFfxJWLmVpVMapttTR7qFVt3CbcxCO08TAChiaoOvUBCokYjRhNjFiNTgtMmVhNy00OWYxLTgwZGMtZTE0NTIyODc5YWIy&fileId=5285890798112366481&keySource=VodBuildInKMS",IV=0x00000000000000000000000000000000
66+
#EXTINF:6.416667,
67+
v.f230.ts?start=5820672&end=5890239&type=mpegts&exper=0&sign=4ed80cd04c3f8f778d5dee9a52592408&t=60fbf938&us=RF69wdt1My3L&whref=xueyuan.xiaoe-tech.com
68+
#EXT-X-ENDLIST
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import m3u8
2+
3+
'''
4+
m3u8 官方文档:https://github.com/globocom/m3u8
5+
'''
6+
with open(r'demo.m3u8','r',encoding='utf-8') as f:
7+
8+
# 解析 m3u8
9+
dict_data = m3u8.parse(f.read())
10+
print(dict_data)
11+
12+
# 获取键值
13+
# print(dict_data.keys())
14+
15+
# 获取 m3u8 分片地址
16+
# for data in dict_data['segments']:
17+
# print(data['uri'])
18+
# start = data['uri'].split('?')[1].split('&')[0]
19+
# end = data['uri'].split('?')[1].split('&')[1]
20+
# print(start + end)
21+
22+
23+
# 获取 m3u8 加密地址
24+
# for data in dict_data['keys']:
25+
# print(data['uri'])
26+
27+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<!--[if lt IE 9]><html lang="en-US" class="lt-ie9 l-ie9" data-n-head-ssr><![endif]-->
3+
<!--[if IE 9]><html lang="en-US" class="lt-ie9 ie9" data-n-head-ssr><![endif]-->
4+
<!--[if (gt IE 9)|!(IE)]><!-->
5+
<html data-n-head-ssr="">
6+
<!--<![endif]-->
7+
<head>
8+
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"/>
9+
<meta content="upgrade-insecure-requests" http-equiv="Content-Security-Policy"/>
10+
<meta content="webkit" name="renderer"/>
11+
<meta content="width=device-width,initial-scale=1" name="viewport"/>
12+
<title>
13+
模拟多个script节点
14+
</title>
15+
<script>
16+
</script>
17+
<script>
18+
</script>
19+
</head>
20+
<body>
21+
<script>
22+
</script>
23+
</body>
24+
<script>
25+
</script>
26+
<script>
27+
</script>
28+
<script type="text/javascript">
29+
alert('靓仔')
30+
</script>
31+
</html>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!doctype html>
2+
<!--[if lt IE 9]><html lang="en-US" class="lt-ie9 l-ie9" data-n-head-ssr><![endif]-->
3+
<!--[if IE 9]><html lang="en-US" class="lt-ie9 ie9" data-n-head-ssr><![endif]-->
4+
<!--[if (gt IE 9)|!(IE)]><!--><html data-n-head-ssr><!--<![endif]-->
5+
<head >
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
7+
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
8+
<meta name="renderer" content="webkit">
9+
<meta name="viewport" content="width=device-width,initial-scale=1">
10+
<title>模拟多个script节点</title>
11+
12+
<script></script>
13+
<script></script>
14+
15+
</head>
16+
<body>
17+
18+
<script></script>
19+
20+
</body>
21+
<script></script>
22+
<script></script>
23+
</html>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from bs4 import BeautifulSoup
2+
3+
'''
4+
BeautifulSoup修改文档树-官方文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/#id45
5+
'''
6+
7+
with open('before.html','r',encoding='utf-8') as f:
8+
9+
soup = BeautifulSoup(f.read(), 'lxml')
10+
11+
12+
# 创建 HTML 的 script 节点
13+
script_tag = soup.new_tag('script', type='text/javascript')
14+
script_tag.string = "alert('靓仔')"
15+
# print(script_tag)
16+
17+
# 获取最后一个 script 节点,向后插入
18+
print('[插入前] 最后一个节点:{}'.format(soup.select('script')[-1]))
19+
soup.select('script')[-1].insert_after(script_tag)
20+
print('[插入后] 最后一个节点:{}'.format(soup.select('script')[-1]))
21+
22+
with open('after.html','w',encoding='utf-8') as f:
23+
f.write(soup.prettify()) # 格式化写入
24+
25+
# print(soup)
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import os
2+
3+
'''
4+
路径常识:
5+
\ 不能在Linux
6+
/ 能够跨平台
7+
推荐使用 / 路径
8+
'''
9+
10+
print('\\')
11+
print('/')
12+
13+
# 遍历文件夹
14+
for dirpath,dirnames,files in os.walk('./素材'):
15+
16+
# 获取有多少个文件
17+
print(files)
18+
19+
# 将文件名排序好
20+
# list_data = [ int(data.replace('.ts','')) for data in files]
21+
# list_data.sort()
22+
# print(list_data)
23+
24+
# 开始写入文件
25+
# for index in list_data:
26+
27+
# # 写入
28+
# with open('file.txt','a+',encoding='utf-8') as f1:
29+
30+
# # 读取
31+
# with open('file.txt','r',encoding='utf-8') as f2:
32+
33+
# # 获取当前绝对路径
34+
# current_filename = os.getcwd().replace('\\','/')
35+
36+
# # 文件名
37+
# filename = current_filename + '/素材/{}.ts'.format(index)
38+
39+
# # 如果该文件名不在里面,就写入
40+
# if filename not in f2.read():
41+
# f1.write("file '{}'\n".format(filename))
42+
43+
44+
# 设置UTF-8编码,让命令行支持中文编码
45+
# cmd = 'ffmpeg.exe -f concat -safe 0 -i file.txt -c copy out.mp4"'
46+
# os.system('CHCP 65001')
47+
# os.system(cmd.replace('/', '\\'))
48+
49+
50+
51+
Binary file not shown.

0 commit comments

Comments
 (0)