获取YouTube直播地址

用到的工具:yt-dlp 或者 YouTube-dl 推荐前者

获取全部格式

yt-dlp --list-formats   YouTube视频直播地址

返回以下信息:记住开头编号 91 94这样的,对应视频质量
[youtube] t6AYgaF-rXM: Downloading webpage
[youtube] t6AYgaF-rXM: Downloading android player API JSON
[youtube] t6AYgaF-rXM: Downloading m3u8 information
[youtube] t6AYgaF-rXM: Downloading m3u8 information
[info] Available formats for t6AYgaF-rXM:
ID EXT RESOLUTION FPS │ TBR PROTO │ VCODEC VBR ACODEC ABR
──────────────────────────────────────────────────────────────────────
91 mp4 256×144 30 │ 269k m3u8_n │ avc1.4d400c 269k mp4a.40.5 0k
92 mp4 426×240 30 │ 507k m3u8_n │ avc1.4d4015 507k mp4a.40.5 0k
93 mp4 640×360 30 │ 962k m3u8_n │ avc1.4d401e 962k mp4a.40.2 0k
94 mp4 854×480 30 │ 1282k m3u8_n │ avc1.4d401f 1282k mp4a.40.2 0k
95 mp4 1280×720 30 │ 2447k m3u8_n │ avc1.4d401f 2447k mp4a.40.2 0k
96 mp4 1920×1080 30 │ 4561k m3u8_n │ avc1.4d4028 4561k mp4a.40.2 0k

获取指定画质YouTube直播M3U8地址

yt-dlp   --list-formats -g  https://www.youtube.com/watch?v=t666666-rXM 

接下来反馈的信息就是真实直播地址了

例如:很明显下面就是m3u8地址

https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/165166614/ei/4kR1YvDWF666avlqjoCQ/ip/216.166.186.166/id/t6AYgaF-rXM.1/itag/96/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/sgoap/gir%3Dye666Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D137/hls_chunk_host/rr5—sn-a5meknsy.googlevideo.com/vprv/1/playlist_type/LIVE/in666dbps/5920/mh/iL/mm/44/mn/sn-a5meknsy/ms/lva/mv/m/mvi/5/pl/19/dover/11/pacing/0/keepalive/yes/fexp/24001373,24007246/mt/1651852129/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,sgoap,sgovp,vprv,playlist_type/sig/AOq0QJ8wRQIhALW3Nhm90txddkikOv_rJR9RADKu3C88wZoZXDrR3c_4AiArK0Cod0__G34Y9PUzQa83dOFuyoYfD97TVs666xdEA%3D%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRQIgZU0Bgl87BG2CKsts8juYMysQXfhJn6HV288CmoYk2aICIQDHq3ZbE9VIuTBOMo2r4itx22p7RU9fG9TH666sIE4A%3D%3D/playlist/index.m3u8

© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片