javascript - 抓取 m3u8 文件的路径
问题描述
我目前正在尝试在嵌入式视频的 m3u8 url 路径中抓取一个唯一值以进行自学。网站上的每个嵌入视频都共享相同的 url 路径,唯一值除外。
例如,从https://headlines.yahoo.co.jp/videonews/ann?a=20190526-00000026-ann-int页面,我可以通过检查器的网络选项卡找到 m3u8 路径:
https://gw-yvpub.c.yimg.jp/v1/hls/CFukHuaO2W13gxbJ/video.m3u8
这里的唯一值是CFukHuaO2W13gxbJ。但是,我终其一生都无法在页面源代码的任何位置或检查器选项卡中的任何其他位置找到此值。是否可以在页面源或生成此 url 的位置找到此 url 链接?
旁注:在请求调用 m3u8 文件之前,对这个 blob url 进行了请求调用:
blob:https://s.yimg.jp/f23ed5ca-7a95-4409-bf66-c26c577157d2
Thanks in advance for any guidance!
解决方案
The m3u8 urls are present in request made to this url:
https://feapi-yvpub.yahooapis.jp/v1/content/1576087?appid=dj0zaiZpPVZMTVFJR0FwZWpiMyZzPWNvbnN1bWVyc2VjcmV0Jng9YjU-&output=json&space_id=2078710316&domain=headlines.yahoo.co.jp&ak=044ddff76151606c2d97ada9daa3ea45&device_type=1100&thumb_width=1204&thumb_height=676&thumb_priority=l&thumb_bd=0
Values for that come from your given url here:
<script type="text/javascript">
YAHOO.JP.srch.dlink.onLoad(function(sl) {
sl.setParams({"serviceCode":"nws","appID":"dj0zaiZpPWlzQ3RiOHo1cGxBNSZzPWNvbnN1bWVyc2VjcmV0Jng9ODQ-","articleID":"20190526-00000026-ann","category":null,"mediaID":"ann","spaceID":2078710316,"linkCount":"5","launchAfterDocLoad":false});
});
</script>
As well as content id seen, for example
<script type="text/javascript" class="yvpub-player" src="https://s.yimg.jp/images/yvpub/player/js/embed.js?contentid=1576087&width=602&height=338&propertyname=jp_news&spaceid=2078710316&repeat=0&recommend=0&autostart=1" data-composed="1"></script>
This 044ddff76151606c2d97ada9daa3ea45
is an access key I think. Not sure if that is something you can re-use across requests. Perhaps also look at the API documentation if there is any. Has a whiff of random hash (probably governed by length) - that could pose problems.
推荐阅读
- javascript - 无法在 React 表单中提交所有数据
- typescript - 确保字符串文字联合属于对象的键
- powerbi - 带有分发列表的 Power BI RLS 不起作用
- c - 使用 OpenSSL 进行高性能 HMAC 计算
- flutter - 在屏幕顶部颤动BottomSheet?
- amazon-ec2 - grafana ec2-instance 按标签过滤
- html - 将脚本生成的 HTML 发送到具有正确表格边距的 Google Doc
- java - 按照创建顺序给定一个所需字符串的数组。由于两个字符串不能相等,因此替换它对它们进行版本控制
- android - 如何在 Exoplayer 通知中设置自定义布局和字体?
- c# - ASP.NET MVC 找不到我的控制器方法