抓取腾讯视频MP4文件

女生的网名这么多〃 提交于 2020-12-29 05:17:38

1. 获取视频播放页地址,如:https://v.qq.com/x/page/g0921owmtc0.html

2. 视频正片开播后,在H5播放器的右键菜单中选择“复制调试信息”。
注意,一定要是H5播放器!不是Flash播放器!
复制出来的信息如下:
{"pid":"dac552a0ecf204cded02a7aca790645f","url":"https%3A%2F%2Fv.qq.com%2Fx%2Fpage%2Fg0921owmtc0.html","vid":"g0921owmtc0","version":"3.5.57","platform":"10201","playtype":1,"emsg2":"%7B%22flow%22%3A%5B%221577759284764%20getinfo%20ok%20603%22%5D%7D","id":"","action":"//btrace.qq.com/kvcollect?BossId=4372&Pwd=967411786","getinfo":"%2F%2Fvd.l.qq.com%2Fproxyhttp%2Fvinfoad%26charge%3D0%26defaultfmt%3Dauto%26otype%3Dojson%26guid%3D98d3c0469a9101f5abc5aa6b5dded4b4%26flowid%3Ddac552a0ecf204cded02a7aca790645f_10201%26platform%3D10201%26sdtfrom%3Dv1010%26defnpayver%3D1%26appVer%3D3.5.57%26host%3Dv.qq.com%26ehost%3Dhttps%253A%252F%252Fv.qq.com%252Fx%252Fpage%252Fg0921owmtc0.html%26refer%3Dv.qq.com%26sphttps%3D1%26tm%3D1577759284%26spwm%3D4%26logintoken%3D%257B%2522main_login%2522%253A%2522%2522%252C%2522openid%2522%253A%2522%2522%252C%2522appid%2522%253A%2522%2522%252C%2522access_token%2522%253A%2522%2522%252C%2522vuserid%2522%253A%2522%2522%252C%2522vusession%2522%253A%2522%2522%257D%26unid%3D053444c01c0311ea981ca042d48ad00a%26vid%3Dg0921owmtc0%26defn%3D%26fhdswitch%3D0%26show1080p%3D1%26isHLS%3D1%26dtype%3D3%26sphls%3D2%26spgzip%3D1%26dlver%3D2%26drm%3D32%26hdcp%3D0%26spau%3D1%26spaudio%3D15%26defsrc%3D1%26encryptVer%3D9.1%26cKey%3DSiOATrh8zFR7-ZEItZs_lpJX5WB4a2CdS8k7SW1vVaqtHEZQ1c_W6myJ8hQKnmnDHJ9pFtGYajsx2vPBr-xE-uhvZyEMY131vUh1H5luGHfrcsJGqTb0Oa9pyEgo9r1rpC8pTw4NTYbYxbsCWjfMEMlPx3OXil-Px4qI-ZMOJR7_qDhELyZ5C4rFL0K_gMo_AKPcJa9KULXRUNvtjUtnAFLIzZVUEz9Bq5Q_4F1iOOI3kpVI6fAuwT4l-ZLyP-KBj3zpSaCEwXYT-rhgLxlTuCsIoyAZgkoDSturzbqrLlWOM06_hfboIj1bBgYGBgYGP2w8wQ%26fp2p%3D1%26spadseg%3D1","getkey":"","uin":"","ua":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML  like Gecko) Chrome/76.0.3809.87 Safari/537.36","refer":"https://v.qq.com/x/page/g0921owmtc0.html","pvid":"2348786210","sessionid":"","main_login":"","vuserid":"","openid":"","appid":"","vurl":"https%3A%2F%2Fapd-bd581e0e3b558be11e7fda99f88d25b4.v.smtcdns.com%2Fomts.tc.qq.com%2FAiMFzCN6R-1hBmCFaAsgw2zQriynFFxWt7SqcCPQzuW4%2FuwMROfz2r5zCIaQXGdGnC2df644Q3LWUuLvyGY4RMhgE_3T2%2FFClzddWE5Dehzt9kd5LtAC_oo6h4dxjsq1qICimKZha-1IeT_khH9CLytaYJy_ShCJoomfhDh9E5gbtOkazYkSaD1OZ9MnpsU-FgmQWacFx0MphtLTm5rGckzsAOyN9gB8nLhCspd8qbq90usXMeCPFPDtSSlHxLs7qC-ZTtvnw%2Fg0921owmtc0.321002.ts.m3u8%3Fver%3D4","cid":"","now":"2019-12-31 10:29:26","defn":"hd","uid":"98d3c0469a9101f5abc5aa6b5dded4b4"}

找到vurl节点,它的值就是视频的真实下载地址了。

3. 发现URL中有带%编码的字符,将它们转化成ASCII字符
http://www.ofmonkey.com/encode/url

上述视频地址转化后变成:
https://apd-bd581e0e3b558be11e7fda99f88d25b4.v.smtcdns.com/omts.tc.qq.com/AiMFzCN6R-1hBmCFaAsgw2zQriynFFxWt7SqcCPQzuW4/uwMROfz2r5zCIaQXGdGnC2df644Q3LWUuLvyGY4RMhgE_3T2/FClzddWE5Dehzt9kd5LtAC_oo6h4dxjsq1qICimKZha-1IeT_khH9CLytaYJy_ShCJoomfhDh9E5gbtOkazYkSaD1OZ9MnpsU-FgmQWacFx0MphtLTm5rGckzsAOyN9gB8nLhCspd8qbq90usXMeCPFPDtSSlHxLs7qC-ZTtvnw/g0921owmtc0.321002.ts.m3u8?ver=4

4.用ffmpeg把m3u8转换成mp4视频

ffmpeg.exe -i https://apd-bd581e0e3b558be11e7fda99f88d25b4.v.smtcdns.com/omts.tc.qq.com/AiMFzCN6R-1hBmCFaAsgw2zQriynFFxWt7SqcCPQzuW4/uwMROfz2r5zCIaQXGdGnC2df644Q3LWUuLvyGY4RMhgE_3T2/FClzddWE5Dehzt9kd5LtAC_oo6h4dxjsq1qICimKZha-1IeT_khH9CLytaYJy_ShCJoomfhDh9E5gbtOkazYkSaD1OZ9MnpsU-FgmQWacFx0MphtLTm5rGckzsAOyN9gB8nLhCspd8qbq90usXMeCPFPDtSSlHxLs7qC-ZTtvnw/g0921owmtc0.321002.ts.m3u8?ver=4 "转换后的视频名称.mp4"

ffmpeg 下载链接: https://pan.baidu.com/s/16_4khlwIC0SKbSRJTV606w 提取码: rssr

 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!