Created
March 8, 2020 06:55
-
-
Save tanuj101/e4411d718cd1b9e2df34ddf90f3e0a72 to your computer and use it in GitHub Desktop.
Script to download a video stream
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
#!/usr/bin/bash | |
mkdir -p /tmp/gfg | |
rm -rf /tmp/gfg/* | |
for ((i=1;i<5;i++)); | |
do | |
seg_num=$(printf %04d $i) | |
curl "https://cdnvideos.geeksforgeeks.org/courses/c9640d9f44fec028c51edd88c2d7acf6gfg-L8-hlsx480p/00000/c9640d9f44fec028c51edd88c2d7acf6gfg-L8-hlsx480p-seg_0$seg_num.ts" -H 'Referer: https://practice.geeksforgeeks.org/tracks/SPC-Hashing/?batchId=140' -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36' -H 'Sec-Fetch-Dest: empty --compressed' --output /tmp/gfg/$seg_num.ts | |
done | |
cat /tmp/gfg/* > video.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment