Skip to content

Instantly share code, notes, and snippets.

@shakahl
Forked from Voronenko/download.sh
Created April 19, 2017 16:22
Show Gist options
  • Save shakahl/ccd34dc4edd02b351fe5f46605209da4 to your computer and use it in GitHub Desktop.
Save shakahl/ccd34dc4edd02b351fe5f46605209da4 to your computer and use it in GitHub Desktop.
m3u stream downloader
#/bin/bash
# $1 like https://xxx/vods3/_definst_/smil:box/cdnstore/modules/xxx.smil/chunklist_b400000.m3u8
CURRENT_COURSE_DIR=xxx
current=${CURRENT_COURSE_DIR-current}
mkdir -p $current/0
next=`ls $current/ | grep -oh '^[0-9]*$' | sed 's/_/ _/' | sort -rn | awk '{printf "%d", $1 + 1; exit}'`
mkdir -p $current/$next
echo writing $current/$next/video.mpg
#cvlc $1 --sout=file/ps:current/$next/video.mpg
echo $1 > $current/$next/$next.txt
ffmpeg -i $1 -c copy -bsf:a aac_adtstoasc $current/$next/$next.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment