Created
April 21, 2014 19:54
-
-
Save alexhornbake/4277348f8b3ab5f7a917 to your computer and use it in GitHub Desktop.
fetch m3u8... follow redirect and fetch segments from akamai
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m3u8Url=$1 | |
masterM3u8=$(curl -L "$m3u8Url" | grep -m1 http) | |
token=$(echo \""$m3u8Url" | grep -o hdnea.*) | |
echo $token | |
echo "fetching... ""$masterM3u8""&""$token" | |
segments=$(curl -c cookies.txt "$masterM3u8""&""$token" | grep http) | |
i=0 | |
while read -r line; do | |
echo "fetching... ""$line" | |
curl -b cookies.txt "$line" > temp_file"$i".ts | |
i=$((i+1)) | |
done <<< "$segments" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment