Script to download a video stream
#!/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