Code Monkey home page Code Monkey logo

Comments (5)

orestonce avatar orestonce commented on May 22, 2024 1

经测试,此m3u8的 key 无法直接下载, 服务端返回给出了400错误, m3u8d 和 m3u8-downloader 发出了相同的请求,收到了相同的回复

  1. m3u8d 会在产生 400 报错后认为流程错误,退出了
  2. llychao/m3u8-downloader 直接忽略了错误, 这是一个bug
  3. ffmpeg 命令行可以验证, 此m3u8的key无法读取:
        ffmpeg -i https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.m3u8 1.mp4
        [hls @ 00000044d8e0bac0] Skip ('#EXT-X-VERSION:3')
        [hls @ 00000044d8e0bac0] Skip ('#EXT-X-ALLOW-CACHE:YES')
        [hls @ 00000044d8e0bac0] Opening 'https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.key' for reading
        [https @ 00000044d8edea80] HTTP error 400 Bad Request
        [hls @ 00000044d8e0bac0] Unable to open key file https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.key
        [hls @ 00000044d8e0bac0] Opening 'crypto+https://hw-mts.videocc.net/0568d5c6f7/0/1654508870102/b/91/ca/4b_3/0568d5c6f7d2f2446fd016519f91ca4b_3_0.ts' for reading

猜测是Referer需要特殊设置,建议给一下原视频播放地址,我分析一下

from m3u8d.

holll avatar holll commented on May 22, 2024

经测试,此m3u8的 key 无法直接下载, 服务端返回给出了400错误, m3u8d 和 m3u8-downloader 发出了相同的请求,收到了相同的回复

  1. m3u8d 会在产生 400 报错后认为流程错误,退出了
  2. llychao/m3u8-downloader 直接忽略了错误, 这是一个bug
  3. ffmpeg 命令行可以验证, 此m3u8的key无法读取:
        ffmpeg -i https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.m3u8 1.mp4
        [hls @ 00000044d8e0bac0] Skip ('#EXT-X-VERSION:3')
        [hls @ 00000044d8e0bac0] Skip ('#EXT-X-ALLOW-CACHE:YES')
        [hls @ 00000044d8e0bac0] Opening 'https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.key' for reading
        [https @ 00000044d8edea80] HTTP error 400 Bad Request
        [hls @ 00000044d8e0bac0] Unable to open key file https://hls.videocc.net/0568d5c6f7/b/0568d5c6f7d2f2446fd016519f91ca4b_3.key
        [hls @ 00000044d8e0bac0] Opening 'crypto+https://hw-mts.videocc.net/0568d5c6f7/0/1654508870102/b/91/ca/4b_3/0568d5c6f7d2f2446fd016519f91ca4b_3_0.ts' for reading

猜测是Referer需要特殊设置,建议给一下原视频播放地址,我分析一下

既然说到Referer了,在文档中好像没有看到支持自定义请求头的功能

from m3u8d.

orestonce avatar orestonce commented on May 22, 2024

既然说到Referer了,在文档中好像没有看到支持自定义请求头的功能

@holll 可以使用curl模式, 将 Referer 的值使用-H参数传入

curl "http://192.168.23.128:1234/index.m3u8" \
 -H 'Referer: www.baidu.com'

from m3u8d.

flying-whale avatar flying-whale commented on May 22, 2024

原网页是需要账号登录并购买才能加载对应的视频,经过网页请求抓包发现加载key的请求是拼接了参数token的,这个token每个视频还不一样,使用llychao/m3u8-downloader下载的ts文件实际上是未使用key解密的,无法正常读取和转码。所以不是你的程序的问题。我自己写个脚本在抓取m3u8链接的同时抓取key保存到本地解码用吧。

from m3u8d.

orestonce avatar orestonce commented on May 22, 2024

@flying-whale 登陆信息是储存在Cookie里的,可以在下载m3u8的时候使用curl模式传入cookie的值试试

from m3u8d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.