Skip to content

Instantly share code, notes, and snippets.

@taroyanaka
Last active August 7, 2018 17:04
Show Gist options
  • Save taroyanaka/0dbb173cb88b4747a93ab2df8980768c to your computer and use it in GitHub Desktop.
Save taroyanaka/0dbb173cb88b4747a93ab2df8980768c to your computer and use it in GitHub Desktop.
DIRNAME=`find -f *.m3u8|awk '{gsub(/\.m3u8/,"");print;}'`
mkdir $DIRNAME
mv *.m3u8 ./$DIRNAME/
cd ./$DIRNAME/
cat *.m3u8|grep https >> new.m3u8
split -l 100 new.m3u8
for i in {a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y}
do;
HOGE="xa$i";
(cat ./$HOGE |
while read line;
do;
curl -s "$line" >> ./$HOGE"1" ;
done;
) &;
done;
wait
cat *1 > all.ts
ls | grep -v -E ".*\.ts" | xargs rm -r
cd ../
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment