Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

申请支持央视网直播源 #442

Open
5 tasks done
toorich opened this issue Aug 6, 2019 · 23 comments
Open
5 tasks done

申请支持央视网直播源 #442

toorich opened this issue Aug 6, 2019 · 23 comments

Comments

@toorich
Copy link
Contributor

toorich commented Aug 6, 2019

在提交前,请确保您已经检查了以下内容!

请将错误输出粘贴在下面:

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也行

@justasmalinauskas
Copy link
Contributor

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:

  1. open page with mobile user agent

  2. their API base url is https://vdn.live.cntv.cn/api2/liveHtml5.do

  3. build channel param, from link http://tv.cctv.com/live/cctv17/m/ use cctv17, then at beginning add pa://cctv_p2p_hd at the end you will get pa://cctv_p2p_hdcctv17

  4. client param = html5

  5. tsp param in their page = new Date().getTime().toString().slice(0,10)

  6. vn param is hardcoded inside https://js.player.cntv.cn/creator/live_common.js and its value = 2049

  7. vc params is difficult one, as it uses function inside live_common.js and named setH5Str 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, like C7413E27B533939F5498E9D8FA2238BB should be valid

  8. uid and wlan can be empty

  9. ip param = 101.248.0.0

  10. 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

  11. after that open url and parse JSON or use regex to get those urls :)

@toorich
Copy link
Contributor Author

toorich commented Aug 6, 2019

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:

  1. open page with mobile user agent
  2. their API base url is https://vdn.live.cntv.cn/api2/liveHtml5.do
  3. build channel param, from link http://tv.cctv.com/live/cctv17/m/ use cctv17, then at beginning add pa://cctv_p2p_hd at the end you will get pa://cctv_p2p_hdcctv17
  4. client param = html5
  5. tsp param in their page = new Date().getTime().toString().slice(0,10)
  6. vn param is hardcoded inside https://js.player.cntv.cn/creator/live_common.js and its value = 2049
  7. vc params is difficult one, as it uses function inside live_common.js and named setH5Str 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, like C7413E27B533939F5498E9D8FA2238BB should be valid
  8. uid and wlan can be empty
  9. ip param = 101.248.0.0
  10. 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
  11. after that open url and parse JSON or use regex to get those urls :)

这样抓出来的直播源是花屏的,没法看,求破

@justasmalinauskas
Copy link
Contributor

@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?

@airdge
Copy link
Collaborator

airdge commented Aug 6, 2019

图片

图片

用html5算法 高清源确实会花屏 低分辨率的不会

@toorich
Copy link
Contributor Author

toorich commented Aug 8, 2019

@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?

不行,也是花屏

@DysaniazzZ
Copy link

他这个是音视频编码改了吧,最早的时候是不花屏的。

@hr3lxphr6j
Copy link
Contributor

hr3lxphr6j commented Jan 20, 2020

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑

捕获

Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

@toorich
Copy link
Contributor Author

toorich commented Jan 25, 2020

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑

捕获

Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

应该是用JS解密吧……

@hr3lxphr6j
Copy link
Contributor

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
捕获
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

应该是用JS解密吧……

h5.worker最开始的字符串就是base64过的wasm

@mengmo
Copy link
Collaborator

mengmo commented Feb 3, 2020

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
捕获
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

应该是用JS解密吧……

h5.worker最开始的字符串就是base64过的wasm

WABT: The WebAssembly Binary Toolkit
无论用哪个工具转换出来的东西都不少,看着头晕。

@mengmo
Copy link
Collaborator

mengmo commented Feb 3, 2020

@hr3lxphr6j
decryptkey 和 iv 必须搞定 wasm 才能算出来吗?

@hr3lxphr6j
Copy link
Contributor

@hr3lxphr6j
decryptkey 和 iv 必须搞定 wasm 才能算出来吗?

能直接调wasm里的这几个函数应该就可以,我试了几个python上跑wasm的库都不行,不知道是不是我姿势不对的原因

@wnpllrzodiac
Copy link

这搞法,和我想法一样啊。处理I祯的前面若干字节的二进制数据,使用aes加密。主要是 iv 和key做好秘密传输就可以了。

@ifnfn
Copy link

ifnfn commented Aug 8, 2021

都放弃破解了?

@joaopa00
Copy link

joaopa00 commented Jul 7, 2022

Any news about this problem?

@zc16607
Copy link

zc16607 commented Sep 19, 2022

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
捕获
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

应该是用JS解密吧……

h5.worker最开始的字符串就是base64过的wasm

WABT: The WebAssembly Binary Toolkit 无论用哪个工具转换出来的东西都不少,看着头晕。

但是目前最新的网页,貌似没有运行这个地方的代码,断点断不到这个位置。目前发现这个加密是跟url地址有关系

@592767809
Copy link

看了下,貌似是对I帧进行了加密,加密的操作在liveplayer_controls.js下面的一坨(应该是魔改版本的hls.js),原本的逻辑
捕获
Module里的函数是h5.worker提供的,貌似用了wasm,暂时没啥好办法

应该是用JS解密吧……

h5.worker最开始的字符串就是base64过的wasm

WABT: The WebAssembly Binary Toolkit 无论用哪个工具转换出来的东西都不少,看着头晕。

但是目前最新的网页,貌似没有运行这个地方的代码,断点断不到这个位置。目前发现这个加密是跟url地址有关系

我是用python还原了一下算法,主要是es流的一些异或操作,还原出来的基本可以播放,但是对于解密后的数据长度变短的问题还没处理好

@ghost
Copy link

ghost commented Jan 14, 2023

現在還有研究嘛?

@592767809
Copy link

目前wasm已经进行了更新,增加了中等程度的控制流混淆。使用jsrpc方式可以完成解密【https://www.52pojie.cn/thread-1708807-1-1.html】。后面准备使用ast进行反混淆进行算法分析

@yeyuchen198
Copy link

目前wasm已经进行了更新,增加了中等程度的控制流混淆。使用jsrpc方式可以完成解密【https://www.52pojie.cn/thread-1708807-1-1.html】。后面准备使用ast进行反混淆进行算法分析

大佬要是能分享1个Python的解密库就好了。现在非加密的m3u8只支持480 x 270,之前的1080 x 720被砍了

@eebssk1
Copy link

eebssk1 commented Dec 16, 2024

目前wasm已经进行了更新,增加了中等程度的控制流混淆。使用jsrpc方式可以完成解密【https://www.52pojie.cn/thread-1708807-1-1.html】。后面准备使用ast进行反混淆进行算法分析

大佬要是能分享1个Python的解密库就好了。现在非加密的m3u8只支持480 x 270,之前的1080 x 720被砍了

360p的也加密了,也是花屏

@letr007
Copy link

letr007 commented Dec 16, 2024

大佬有解决办法么

@eebssk1
Copy link

eebssk1 commented Dec 16, 2024

大佬有解决办法么

看了下官方播放器关于帧解密的代码基本没变。估计帖子里面jsonrpc直接调用官方解密库的方法还值得一试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests