shell 下载aliplayer 的视频
#!/bin/bash url="http://v.example.com/8dedaec32ca9415eaa8ccd423ee33bf3/" #下载视频索引文件 wget --referer ‘http://www.example.com‘ ${url}"5a700d867b4d461bd6220d292c6a22a9-fd.m3u8" -O "source.m3u8" mkdir "./part" #循环下载视频片段,存入part文件夹中 for line in $(cat source.m3u8|grep ‘.ts‘) do echo $url$line wget --referer ‘http://www.example.com‘ $url$line -P "./part" done #合成视频,需支持ffmpeg cat part/*.ts | ffmpeg -i pipe: -c:a copy -c:v copy output.mp4
原理:
m3u8文件存放视频片段地址(header需带refer),批量下载下来然后拼接成一个mp4
相关推荐
tianhuak 2020-11-24
huha 2020-10-16
lianshaohua 2020-09-23
laisean 2020-11-11
zhangjie 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
以梦为马不负韶华 2020-10-20
CARBON 2020-10-20
彼岸随笔 2020-10-20
lianshaohua 2020-10-20
yutou0 2020-10-17
JohnYork 2020-10-16
xiaonamylove 2020-10-16
Julyth 2020-10-16
applecarelte 2020-10-16
ourtimes 2020-10-16