Download a segmented video file

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion mclionheadlion mclionhead 05/30/2020 at 04:230 Comments

It's a problem we've all come to know in the last 10 years.  We want to download a video from a site other than the goo tubes, so we start up the network panel in Chrome & load the page.  Then, we look for the largest files being downloaded & files ending in .ts, .mp4, or .webm.  The problem is, it downloads a bunch of small files containing a number like 00002. 

It's a pain in the ass segmented video.  The trick is finding the 1st & last segment numbers.  Seek to the end of the video to get the last segment number.  Seek to the start of the video to get the 1st segment number.  After being stymied by these files for years, the lion kingdom finally decided to automate the process with a dead simple program.

It just searches the URL for the starting number & replaces that block of text with every number until the ending number. If the result is a stream format like .ts, the files can all be concatenated.  If it's a .mp4, the files have to be loaded into an editor.  Currently, it downloads base 10 numbers.  It could be hacked to download hex numbers.

While it works for some PBS videos & some local TV stations, it doesn't work for discovery channel.  They use some kind of encryption.