Skip to content

Instantly share code, notes, and snippets.

@maxchuquimia
Last active January 14, 2020 05:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxchuquimia/446acb5fcd1f5faf9cdf8c101938e816 to your computer and use it in GitHub Desktop.
Save maxchuquimia/446acb5fcd1f5faf9cdf8c101938e816 to your computer and use it in GitHub Desktop.
A one-liner to download a segmented stream from the internet. Adjust the prefix zeros as needed in the printf.
for i in {0..999}; do i=$(printf "%03d" $i); echo -en " Downloading $i\r"; curl -s --fail "<url>/segment_$i.ts" >> /tmp/test.ts || break; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment