Monibuca / plugin-hls

HLS协议的实现,提供HLS协议拉流,和HLS的写磁盘功能
MIT License
40 stars 40 forks source link

youtube的hls 拉流失败,提示为{"streamPath": "live/test", "error": "invalid playlist, must start with #EXTM3U"} #11

Closed MRDHR closed 1 year ago

MRDHR commented 1 year ago

大佬你好: 我使用monibuca转发youtube的hls无法成功。提示{"streamPath": "live/test", "error": "invalid playlist, must start with #EXTM3U"},查看了获取到的m3u8文件,第一行确实是#EXTM3U开头的 image

链接 http://[192.210.231.147:10081/hls/api/pull?streamPath=live/test&target=https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1681290112/ei/IB82ZMXAHridsfIPoZmUwA4/ip/192.210.231.147/id/o5yDTBGrp7o.1/itag/300/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D298/hls_chunk_host/rr4---sn-o097znsk.googlevideo.com/spc/99c5CdiJ7o5agrWEb8KbHBYY71iTEdo/vprv/1/playlist_type/LIVE/mh/y-/mm/44/mn/sn-o097znsk/ms/lva/mv/u/mvi/4/pl/26/dover/11/pacing/0/keepalive/yes/fexp/24007246/mt/1681268151/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,spc,vprv,playlist_type/sig/AOq0QJ8wRgIhAPPHdmR-HC-QxBRt9XlY1eUsqQ7p8BCPlIJu4YFRXzfQAiEA7Nzl6oaYAFSiX2pKOn4Lz7SU_ibbt-x3QkuGyLmkw9w%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAM-5uX_DEoe6sHjGYDeYe4GDHxLhQlFMFpveHluSuDHZAiAXyHQnykOsJfyJD8y6I3oBF9feGgDUmO0jT6fi7NAVag%3D%3D/playlist/index.m3u8](http://192.210.231.147:10081/hls/api/pull?streamPath=live/test&target=https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1681290112/ei/IB82ZMXAHridsfIPoZmUwA4/ip/192.210.231.147/id/o5yDTBGrp7o.1/itag/300/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D298/hls_chunk_host/rr4---sn-o097znsk.googlevideo.com/spc/99c5CdiJ7o5agrWEb8KbHBYY71iTEdo/vprv/1/playlist_type/LIVE/mh/y-/mm/44/mn/sn-o097znsk/ms/lva/mv/u/mvi/4/pl/26/dover/11/pacing/0/keepalive/yes/fexp/24007246/mt/1681268151/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,spc,vprv,playlist_type/sig/AOq0QJ8wRgIhAPPHdmR-HC-QxBRt9XlY1eUsqQ7p8BCPlIJu4YFRXzfQAiEA7Nzl6oaYAFSiX2pKOn4Lz7SU_ibbt-x3QkuGyLmkw9w%3D/lsparams/hls_chunk_host,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIhAM-5uX_DEoe6sHjGYDeYe4GDHxLhQlFMFpveHluSuDHZAiAXyHQnykOsJfyJD8y6I3oBF9feGgDUmO0jT6fi7NAVag%3D%3D/playlist/index.m3u8)

终端日志截图 image

langhuihui commented 1 year ago

这个问题就是需要你对target的值要进行URLencode,否则m7s获取到的target会有问题,URL里面包含了特殊字符就会这样

MRDHR commented 1 year ago

有个尴尬的问题,这个URL不能做urlencode的,做了urlencode就会获取不到m3u8。是否有其他的解决方案?

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: dexter @.> 发送时间: 2023年4月12日 11:19 收件人: Monibuca/plugin-hls @.> 抄送: Mrdeng @.>, Author @.> 主题: Re: [Monibuca/plugin-hls] youtube的hls 拉流失败,提示为{"streamPath": "live/test", "error": "invalid playlist, must start with #EXTM3U"} (Issue #11)

这个问题就是需要你对target的值要进行URLencode,否则m7s获取到的target会有问题,URL里面包含了特殊字符就会这样

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

langhuihui commented 1 year ago

你试过了吗,因为到服务器的话会解一层

langhuihui commented 1 year ago

你这个地址里面因为已经有很多参数是经过encode了,确实如果直接输入浏览器肯定不行了

MRDHR commented 1 year ago

那我试试urlencode一下的,之前试过好像是不行 就没再试了

发自我的iPhone

------------------ 原始邮件 ------------------ 发件人: dexter @.> 发送时间: 2023年4月12日 11:24 收件人: Monibuca/plugin-hls @.> 抄送: Mrdeng @.>, Author @.> 主题: Re: [Monibuca/plugin-hls] youtube的hls 拉流失败,提示为{"streamPath": "live/test", "error": "invalid playlist, must start with #EXTM3U"} (Issue #11)

你这个地址里面因为已经有很多参数是经过encode了,确实如果直接输入浏览器肯定不行了

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

MRDHR commented 1 year ago

试过了,无法播放 终端日志,创建拉流成功 image

拿到的monibuca分发的m3u8截图 image

请求连接 http://[192.210.231.147:10081/hls/api/pull?streamPath=live/test&target=https%3A%2F%2Fmanifest.googlevideo.com%2Fapi%2Fmanifest%2Fhls_playlist%2Fexpire%2F1681290112%2Fei%2FIB82ZMXAHridsfIPoZmUwA4%2Fip%2F192.210.231.147%2Fid%2Fo5yDTBGrp7o.1%2Fitag%2F300%2Fsource%2Fyt_live_broadcast%2Frequiressl%2Fyes%2Fratebypass%2Fyes%2Flive%2F1%2Fsgoap%2Fgir%253Dyes%253Bitag%253D140%2Fsgovp%2Fgir%253Dyes%253Bitag%253D298%2Fhls_chunk_host%2Frr4---sn-o097znsk.googlevideo.com%2Fspc%2F99c5CdiJ7o5agrWEb8KbHBYY71iTEdo%2Fvprv%2F1%2Fplaylist_type%2FLIVE%2Fmh%2Fy-%2Fmm%2F44%2Fmn%2Fsn-o097znsk%2Fms%2Flva%2Fmv%2Fu%2Fmvi%2F4%2Fpl%2F26%2Fdover%2F11%2Fpacing%2F0%2Fkeepalive%2Fyes%2Ffexp%2F24007246%2Fmt%2F1681268151%2Fsparams%2Fexpire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cratebypass%2Clive%2Csgoap%2Csgovp%2Cspc%2Cvprv%2Cplaylist_type%2Fsig%2FAOq0QJ8wRgIhAPPHdmR-HC-QxBRt9XlY1eUsqQ7p8BCPlIJu4YFRXzfQAiEA7Nzl6oaYAFSiX2pKOn4Lz7SU_ibbt-x3QkuGyLmkw9w%253D%2Flsparams%2Fhls_chunk_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Flsig%2FAG3C_xAwRQIhAM-5uX_DEoe6sHjGYDeYe4GDHxLhQlFMFpveHluSuDHZAiAXyHQnykOsJfyJD8y6I3oBF9feGgDUmO0jT6fi7NAVag%253D%253D%2Fplaylist%2Findex.m3u8](http://192.210.231.147:10081/hls/api/pull?streamPath=live/test&target=https%3A%2F%2Fmanifest.googlevideo.com%2Fapi%2Fmanifest%2Fhls_playlist%2Fexpire%2F1681290112%2Fei%2FIB82ZMXAHridsfIPoZmUwA4%2Fip%2F192.210.231.147%2Fid%2Fo5yDTBGrp7o.1%2Fitag%2F300%2Fsource%2Fyt_live_broadcast%2Frequiressl%2Fyes%2Fratebypass%2Fyes%2Flive%2F1%2Fsgoap%2Fgir%253Dyes%253Bitag%253D140%2Fsgovp%2Fgir%253Dyes%253Bitag%253D298%2Fhls_chunk_host%2Frr4---sn-o097znsk.googlevideo.com%2Fspc%2F99c5CdiJ7o5agrWEb8KbHBYY71iTEdo%2Fvprv%2F1%2Fplaylist_type%2FLIVE%2Fmh%2Fy-%2Fmm%2F44%2Fmn%2Fsn-o097znsk%2Fms%2Flva%2Fmv%2Fu%2Fmvi%2F4%2Fpl%2F26%2Fdover%2F11%2Fpacing%2F0%2Fkeepalive%2Fyes%2Ffexp%2F24007246%2Fmt%2F1681268151%2Fsparams%2Fexpire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cratebypass%2Clive%2Csgoap%2Csgovp%2Cspc%2Cvprv%2Cplaylist_type%2Fsig%2FAOq0QJ8wRgIhAPPHdmR-HC-QxBRt9XlY1eUsqQ7p8BCPlIJu4YFRXzfQAiEA7Nzl6oaYAFSiX2pKOn4Lz7SU_ibbt-x3QkuGyLmkw9w%253D%2Flsparams%2Fhls_chunk_host%2Cmh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Flsig%2FAG3C_xAwRQIhAM-5uX_DEoe6sHjGYDeYe4GDHxLhQlFMFpveHluSuDHZAiAXyHQnykOsJfyJD8y6I3oBF9feGgDUmO0jT6fi7NAVag%253D%253D%2Fplaylist%2Findex.m3u8)

MRDHR commented 1 year ago

hls插件是否需要ffmpeg环境?

MRDHR commented 1 year ago

尝试使用ffmpeg读取monibuca输出的urldecode之后的target m3u8地址,是可以读取到ts的, image

langhuihui commented 1 year ago

嗯,读取ts没问题,我这边试过了,但是这个流我这边用ffplay也播放的有问题

MRDHR commented 1 year ago

嗯,读取ts没问题,我这边试过了,但是这个流我这边用ffplay也播放的有问题

这个流读取要用代理,最好是你那边能获取一份专属的播放器地址。 获取方式:python3 安装yt-dlp

执行命令 yt-dlp -f best -g xxxxx,就可以获取到m3u8链接了

MRDHR commented 1 year ago

嗯,读取ts没问题,我这边试过了,但是这个流我这边用ffplay也播放的有问题

或者我提供一个ubuntu的服务器给你,你可以在这台服务器上进行编译 调试等操作

MRDHR commented 1 year ago

image

MRDHR commented 1 year ago

这个实在不行就只能用ffmpeg 手动给rtmp推流了。

langhuihui commented 1 year ago

你加我微信吧yigehui

MRDHR commented 1 year ago

好的 已经加你了