ykdl
ykdl copied to clipboard
申请支持央视网直播源
在提交前,请确保您已经检查了以下内容!
- [x] 你确实可以在浏览器或移动端中观看视频,但不能使用
ykdl
下载。 - [x] 您的
ykdl
为最新版。 - [x] 您已经阅读并按 https://github.com/zhangn1985/ykdl/wiki 中的指引进行了操作。
- [x] 您的问题没有在 https://github.com/zhangn1985/ykdl/issues 报告,否则请在原有 issue 下报告。
- [x] 本问题确实关于
ykdl
,而不是其他项目。
请将错误输出粘贴在下面:
ykdl -i http://tv.cctv.com/live/cctv17/ --debug DEBUG:common:video_host> tv.cctv.com DEBUG:common:short_name> cctv DEBUG:html:get_content> URL: http://tv.cctv.com/live/cctv17/ DEBUG:html:get_content> Charset: UTF-8 CRITICAL:YKDL:cant find vid
如果您有其他附言,例如问题只在某个视频发生,或者是一般性讨论或者提出新功能,请在下面添加:
如题,哪怕只能解析出m3u8也行
I can share the way how they do it, I'm not sure I get time to do this myself, but for others it may be a perfect reference point:
-
open page with mobile user agent
-
their API base url is
https://vdn.live.cntv.cn/api2/liveHtml5.do
-
build
channel
param, from linkhttp://tv.cctv.com/live/cctv17/m/
usecctv17
, then at beginning addpa://cctv_p2p_hd
at the end you will getpa://cctv_p2p_hdcctv17
-
client
param =html5
-
tsp
param in their page =new Date().getTime().toString().slice(0,10)
-
vn
param is hardcoded insidehttps://js.player.cntv.cn/creator/live_common.js
and its value =2049
-
vc
params is difficult one, as it uses function insidelive_common.js
and namedsetH5Str
and it uses (tsp, client, "47899B86370B879139C08EA3B5E88267", vdn_uid), but I think they dont validate that, so any 32 char long HEX valid name in uppercase, likeC7413E27B533939F5498E9D8FA2238BB
should be valid -
uid
andwlan
can be empty -
ip
param =101.248.0.0
-
final url looks like:
https://vdn.live.cntv.cn/api2/liveHtml5.do?channel=pa://cctv_p2p_hdcctv17&client=html5&tsp=1565089293&vn=2049&vc=C7413E27B533939F5498E9D8FA2238BB&uid=&wlan=&ip=101.248.0.0
-
after that open url and parse JSON or use regex to get those urls :)
I can share the way how they do it, I'm not sure I get time to do this myself, but for others it may be a perfect reference point:
- open page with mobile user agent
- their API base url is
https://vdn.live.cntv.cn/api2/liveHtml5.do
- build
channel
param, from linkhttp://tv.cctv.com/live/cctv17/m/
usecctv17
, then at beginning addpa://cctv_p2p_hd
at the end you will getpa://cctv_p2p_hdcctv17
client
param =html5
tsp
param in their page =new Date().getTime().toString().slice(0,10)
vn
param is hardcoded insidehttps://js.player.cntv.cn/creator/live_common.js
and its value =2049
vc
params is difficult one, as it uses function insidelive_common.js
and namedsetH5Str
and it uses (tsp, client, "47899B86370B879139C08EA3B5E88267", vdn_uid), but I think they dont validate that, so any 32 char long HEX valid name in uppercase, likeC7413E27B533939F5498E9D8FA2238BB
should be validuid
andwlan
can be emptyip
param =101.248.0.0
- final url looks like:
https://vdn.live.cntv.cn/api2/liveHtml5.do?channel=pa://cctv_p2p_hdcctv17&client=html5&tsp=1565089293&vn=2049&vc=C7413E27B533939F5498E9D8FA2238BB&uid=&wlan=&ip=101.248.0.0
- after that open url and parse JSON or use regex to get those urls :)
这样抓出来的直播源是花屏的,没法看,求破
@toorich In their flash player, they use api endpoint, which looks like http://vdn.live.cntv.cn/api2/live.do?channel=pa://cctv_p2p_hdcctv17&client=flash&tsp=1565095762&vn=1543&vc=391A3078A64AEB778540A382CB035B76
Links from there work for you?
用html5算法 高清源确实会花屏 低分辨率的不会
@toorich In their flash player, they use api endpoint, which looks like
http://vdn.live.cntv.cn/api2/live.do?channel=pa://cctv_p2p_hdcctv17&client=flash&tsp=1565095762&vn=1543&vc=391A3078A64AEB778540A382CB035B76
Links from there work for you?
不行,也是花屏
他这个是音视频编码改了吧,最早的时候是不花屏的。
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
应该是用JS解密吧……
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
应该是用JS解密吧……
h5.worker最开始的字符串就是base64过的wasm
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
应该是用JS解密吧……
h5.worker最开始的字符串就是base64过的wasm
WABT: The WebAssembly Binary Toolkit 无论用哪个工具转换出来的东西都不少,看着头晕。
@hr3lxphr6j decryptkey 和 iv 必须搞定 wasm 才能算出来吗?
@hr3lxphr6j decryptkey 和 iv 必须搞定 wasm 才能算出来吗?
能直接调wasm里的这几个函数应该就可以,我试了几个python上跑wasm的库都不行,不知道是不是我姿势不对的原因
这搞法,和我想法一样啊。处理I祯的前面若干字节的二进制数据,使用aes加密。主要是 iv 和key做好秘密传输就可以了。
都放弃破解了?
Any news about this problem?
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
应该是用JS解密吧……
h5.worker最开始的字符串就是base64过的wasm
WABT: The WebAssembly Binary Toolkit 无论用哪个工具转换出来的东西都不少,看着头晕。
但是目前最新的网页,貌似没有运行这个地方的代码,断点断不到这个位置。目前发现这个加密是跟url地址有关系
看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法
应该是用JS解密吧……
h5.worker最开始的字符串就是base64过的wasm
WABT: The WebAssembly Binary Toolkit 无论用哪个工具转换出来的东西都不少,看着头晕。
但是目前最新的网页,貌似没有运行这个地方的代码,断点断不到这个位置。目前发现这个加密是跟url地址有关系
我是用python还原了一下算法,主要是es流的一些异或操作,还原出来的基本可以播放,但是对于解密后的数据长度变短的问题还没处理好
現在還有研究嘛?
目前wasm已经进行了更新,增加了中等程度的控制流混淆。使用jsrpc方式可以完成解密【https://www.52pojie.cn/thread-1708807-1-1.html】。后面准备使用ast进行反混淆进行算法分析