shell m3u8-->ts

1490 단어 shellShell
shell:m3u8-->ts
  • 수요: 이미 알 고 있 는 대량 m3u 8 uri, 전체 ts 파일 uri
  • #  sed       ,      test_file
    #curl -s         
    #  % 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         :
    #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/bash
    
    m3u8_list=`cat m3u8`
    for i in $m3u8_list
    do
            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
            done
    done
  • m3u8:
  • http://14.18.146.165:8802/vod/ymx//225731_3/index.m3u8
    http://14.18.146.165:8802/vod/ymx//225731_4/index.m3u8
    http://14.18.146.165:8802/vod/ymx//225731_5/index.m3u8
  • all_log:
  • [root@test-CNC-TJ-19-28 yuhuancun]# head 171723.txt
    http://14.18.146.165:8802/vod/hn_live_165/8592_58438/index.m3u8
    http://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_0.ts
    http://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_1.ts
    http://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_2.ts
    http://14.18.146.165:8802/vod/hn_live_165/8592_58438/video_3.ts

    좋은 웹페이지 즐겨찾기