Shell M3u8-->ts

Source: Internet
Author: User
Tags curl

Shell:m3u8-->ts
    • Requirement: Known bulk m3u8 uri for full TS file uri

#由于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
    • m3u8:

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
    • All_log:

[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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.