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

推荐订阅源

Apple Machine Learning Research
Apple Machine Learning Research
M
MIT News - Artificial intelligence
罗磊的独立博客
博客园 - 【当耐特】
A
About on SuperTechFans
Last Week in AI
Last Week in AI
雷峰网
雷峰网
IT之家
IT之家
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
博客园_首页
博客园 - 叶小钗
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - Franky
J
Java Code Geeks
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
The Cloudflare Blog
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
S
SegmentFault 最新的问题
Recent Announcements
Recent Announcements

博客园 - 风与叶子

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