Skip to content

Instantly share code, notes, and snippets.

@Stargateur
Last active December 25, 2016 00:02
Show Gist options
  • Save Stargateur/eea84b207f940cbe86ade22efca8e813 to your computer and use it in GitHub Desktop.
Save Stargateur/eea84b207f940cbe86ade22efca8e813 to your computer and use it in GitHub Desktop.
download rwby episode
#/bin/bash
episode="episode7"
mkdir "${episode}"
if [ $? -eq 1 ]
then
echo episode already exist
exit 1
fi
cd ${episode}
list="list.txt"
> ${list}
url='http://wpc.1765a.taucdn.net/801765A/video/uploads/videos/4836d6d7-dbfb-4a79-a623-44910ee90353'
for number in {00001..99999}
do
file="${number}.ts"
curl "${url}/NewHLS-1080P${file}" -o "${file}"
if [ $(tail -c 8 "${file}") == '</Error>' ]
then
rm "${file}"
break
else
echo "file '${file}'" >> ${list}
fi
done
ffmpeg -f concat -i ${list} -c copy "episode.mkv"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment