M3U8文件真实TS流获取工具
2015-12-23 11:31
531 查看
在进行一些M3U8文件的学习中,自己写了这个抓取全文件TS流的脚本(cygwin和linux中都可以自行),为了加快下载速度还进行多线程的优化!
0x00 使用方法:
xx.sh http://30.9.159.145:8080/ts_file/gare1/fileSequence 0 169
http://30.9.159.145:8080/ts_file/gare1/fileSequence 就是真实ts流的前缀名称(http://30.9.159.145:8080/ts_file/gare1/fileSequence0.ts 去除 0.ts)
0 是起始的TS流计数
169 是中止的TS流计数
0x01 xx.sh脚本如下:
#!/bin/sh
if [ -n "$1" -a -n "$2" -a -n "$3" ]
then
echo "begin down"
else
echo "Sorry,you didn't identify hls url prefix."
exit
fi
count=$2
url=$1
while (( $count <= $3 ));
do
echo "\$@ Parameter index #$count = $count"
wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16" "$url$count.ts" &
count=$[ $count + 1 ]
if (( $count%3 == 0));then
echo "wait for 5 jobs ends start"
wait
echo "wait for 5 jobs ends end"
fi
done
wait
echo "download ok======================!"
0x00 使用方法:
xx.sh http://30.9.159.145:8080/ts_file/gare1/fileSequence 0 169
http://30.9.159.145:8080/ts_file/gare1/fileSequence 就是真实ts流的前缀名称(http://30.9.159.145:8080/ts_file/gare1/fileSequence0.ts 去除 0.ts)
0 是起始的TS流计数
169 是中止的TS流计数
0x01 xx.sh脚本如下:
#!/bin/sh
if [ -n "$1" -a -n "$2" -a -n "$3" ]
then
echo "begin down"
else
echo "Sorry,you didn't identify hls url prefix."
exit
fi
count=$2
url=$1
while (( $count <= $3 ));
do
echo "\$@ Parameter index #$count = $count"
wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16" "$url$count.ts" &
count=$[ $count + 1 ]
if (( $count%3 == 0));then
echo "wait for 5 jobs ends start"
wait
echo "wait for 5 jobs ends end"
fi
done
wait
echo "download ok======================!"
相关文章推荐
- 在iOS 8中使用UIAlertController
- 日经春秋 20151223
- 【转载】理解VB中选择语句Select Case结构的最好例子
- iOS 在UILabel显示不同的字体和颜色
- Linux Kernel devm_* API源码分析
- 执行计划解读 简朝阳 (Sky Jian) and 那蓝蓝海
- idea 15破解方法记录
- linux 命令行快捷键
- C++将username部分用*取代
- Use Memcached for Java enterprise performance, Part 1: Architecture and setup
- android 工程架构
- 微信开发一(获取用户基本信息)
- python之单例设计模式
- 关于uitableviewcell的accessoryType属性
- 1027. 打印沙漏(20)
- Android layout_weight的奇葩特性
- Spring MVC之@RequestMapping参数详解
- iOS调用相册和摄像头
- stm32 4*4矩阵键盘
- eclipse里访问tomcat首页出现404错误解决方法