gpt4 book ai didi

ios - 如何检查 hls url 是否受 DRM 保护?

转载 作者:行者123 更新时间:2023-11-29 05:45:15 28 4
gpt4 key购买 nike

我有一个来自服务器的视频的 hls 网址。我想检查内容是否受 DRM 保护。有没有办法以编程方式检查 hls url 在 iOS 中是否 protected ?

最佳答案

根据所使用的容器,视频元数据将包含显示视频已加密的信息,并且 list (作为 HLS 流的顶级索引的 m3u8 文件)也将包含加密信息。

最快的方法通常是检查 list ,如评论中所述。

您可以扫描 list (通常是一个相对较小的文本文件)中的术语“EXT-X-KEY” - 它用于包含保护系统信息,如果存在,则文件通常已加密。

HLS RFC ( https://www.rfc-editor.org/rfc/rfc8216 ) 包含更多信息,其中包括此摘要:

Media Segments MAY be encrypted. The EXT-X-KEY tag specifies how todecrypt them. It applies to every Media Segment and to every MediaInitialization Section declared by an EXT-X-MAP tag that appearsbetween it and the next EXT-X-KEY tag in the Playlist file with thesame KEYFORMAT attribute (or the end of the Playlist file). Two ormore EXT-X-KEY tags with different KEYFORMAT attributes MAY apply tothe same Media Segment if they ultimately produce the same decryptionkey. The format is:

#EXT-X-KEY: <attribute-list>

示例 list 可能如下所示:

#EXTM3U
#EXT-X-VERSION:1
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="https://your_license_server/your.key"
#EXTINF:4, no desc
video-audio=65000-video=360000-0.ts

关于ios - 如何检查 hls url 是否受 DRM 保护?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56219628/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com