Search code examples
video-capture

How to get the video file for a movie currently playing in browser?


So I have a youtube page open where I can watch a video.

But this video was taken down by the user. My open page still has the video, if you go to it again (refresh) the new page does not.

Since I have the video loaded in my browser tab (chrome), how can I go about finding the actual file and saving it?


Solution

  • In the old days of YouTube, it may have been possible to find the single video file on your harddrive and save it, but this is no longer the case. As explained in this Computerphile video, all YouTube videos are now split into tiny pieces and downloaded piece by piece.

    You can observe this for yourself if you open up Chrome (or Firefox's) Dev Tools and watch the nnetwork tab. You'll see: Pieces of Youtube video
    all of the pieces of the video loading bit by bit.

    One additional thing you'll learn from the Network tab is that the videos are downloaded as octet streams, so you won't be able to find the links to the pieces hidden in the DOM.

    One thing you migth try is, in the Network tab, clear the results and then move the cursor to the beginning of the video. You should see the streams come up again. Right click on the path name and then do a "save as", and save it as 0000.mp4 (or whatever), for all the pieces. You should be able to reassemble these pieces in any video editing software. I tested this by getting two pieces from a random YouTube video.