惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
B
Blog
博客园 - Franky
I
InfoQ
A
About on SuperTechFans
博客园_首页
L
LangChain Blog
量子位
腾讯CDC
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
美团技术团队
V
V2EX
Apple Machine Learning Research
Apple Machine Learning Research
雷峰网
雷峰网
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
G
Google Developers Blog
Last Week in AI
Last Week in AI

博客园 - 风与叶子

flutter event_bus 底层技术 Linux libreoffice安装 word转pdf 中文乱码(缺少字体解决) 设计短链接(short URL)系统 羊了个羊小程序通关脚本 Nginx反向代理location与proxy_pass配置规则总结 mysql 删除异常进程脚本 docker 设置国内镜像源 python2.7 升级到 python3.6 aliyun OOS 资源同步【ossutil】 shell之文件路径截取 获取淘宝订单的解决方案——转 mysql实例的连接数max_user_connections 和max_connections 配置的那些事 Git log怎么查看分支提交过哪些文件 一篇文章搞定Git——Git代码管理及使用规范 小程序获取手机号 thinkphp3.2.3 CentOS7 YUM 安装MongoDB 4.0 使用iptables给特定IP或端口限流 多台centos服务器同步更新代码文件 Nginx1.14.0+ModSecurity实现简单的WAF
shell 下载aliplayer 的视频
风与叶子 · 2020-01-18 · via 博客园 - 风与叶子
#!/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