Shell:m3u8-->ts
#由于sed不支持文本替换, generate temporary files test_file#curl -s ignore the default output as follows # % total % Received % Xferd Average Speed Time time time current# Dload Upload Total spent left speed#107 537 107 537 0 0 1987 0 --:--:-- --:--:-- --:--:-- 4007# #sed Replace four ways: #1. eval sed ' s/$a/$b/' filename#2.sed ' s/$a/$b/" filename#3.sed ' s/' $a '/' $b '/' filename #4. sed s/$a/$b/ filename#!/bin/bashm3u8_list= ' cat m3u8 ' for i in $m 3u8_listdo echo "$i" &>> all_log ts_ List= ' curl -s $i | grep ' \.ts$ ' for j in $ts _list do echo "$i" > test_file sed "s/ index.m3u8/$j/" test_file &>> all_log Donedone
http://14.18.146.165:8802/vod/ymx//225731_3/index.m3u8http://14.18.146.165:8802/vod/ymx//225731_4/ Index.m3u8http://14.18.146.165:8802/vod/ymx//225731_5/index.m3u8
[Email protected] yuhuancun]# head 171723.txthttp://14.18.146.165:8802/vod/hn_live_165/8592_58438/index.m3u8http ://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_0.tshttp://14.18.146.165:8802/vod/hn_live_165/8592_ 58438/video_1.tshttp://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_2.tshttp://14.18.146.165:8802/vod/ Hn_live_165/8592_58438/video_3.ts
This article is from the "Rookie on the Road" blog, please be sure to keep this source http://duanyifei.blog.51cto.com/9618411/1944833
Shell M3u8-->ts