I have a habit (some say lousy habit) that I have to download every video that I want to watch online, because of the low bandwidth that I have at home.
Recently, I found a tutorial video for "Bash & BugBounty" in 2 parts. (Part 1 & Part 2)
These videos, at first sight, aren't downloadable and protected by ArvanCloud services such as WAF, etc.
It made me mad and frustrated about this action, so I have to come up with an idea to calm myself down. In other words, I had to download those videos. :)
After a long time banging my head to keyboard and thinking in every way, I finally found a way :)
Let's get into it:
- I analyzed source code using inspect element from browser looking for
iframe src=
orsrc=
, and then I found a link I was looking for. Analyze file from Source Page and Inspect Element from browser. - First video link and Second video link
- Then I fired up the inspect element and looked in the network section, and I found a pattern.
- The video streamed through different segments. So I looked at the first one and the last one and copy their URL.
Example from part 2 of that tutorial:
First link:
https://memoryleak.arvanvod.com/kb7yZJyN0g/PeAWr4vmMl/h_,144_200,240_400,360_800,480_1500,720_2500,1080_4366,k.mp4.list/seg-1-f5-v1-a1.ts
Last link:
https://memoryleak.arvanvod.com/kb7yZJyN0g/PeAWr4vmMl/h_,144_200,240_400,360_800,480_1500,720_2500,1080_4366,k.mp4.list/seg-392-f5-v1-a1.ts
- Then I wrote a script to make a download list and use
wget
command to download all segments. (FYI, There were 491 segments in the first video and 392 segments in the second video) (Check the link-maker.sh)
bash link-maker.sh > links.txt
wget --tries=0 --wait=5 --random-wait --input-file=links.txt
- After that, I had to concatenate all segments to have a single file. (Check the concatenate.sh)
bash concatenate.sh > all.ts
- Finally, I had to convert
.ts
extension to a more convenient one such as.mp4
with another shell command:
ffmpeg -i all.ts -acodec copy -vcodec copy final.mp4
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.