How do I create a URL identical to the direct download URL created by my browser when I save a file from the web?


I am streaming video files from the web using VLC player but most files I can only stream with a direct download URL to the file, as opposed to the file URL as it appears on the web.

To be specific, if I select the file URL on the web and click Copy Link Location, the copied URL will not stream. If I select the URL and click Save Link As..., a direct download URL is created which the browser uses to download the file; I can copy the new direct download URL by right clicking Copy Download Link on the saved file in the Downloads folder, even if the download is incomplete or cancelled. Currently I’m using this awkward workaround and I’m looking for a more sophisticated approach.

Here is a specific example I’ve encountered recently streaming large (3-4GB) .mkv files from a public Google Drive folder: this initial page contains an embedded player and some Google Drive buttons in the header. I click the download button leading to the next page warning me that the file is to large for virus-scan. If I right click the Download anyway button and select Copy Link Location, the copied URL does not stream but if I select Save Link As... (or just left click Download anyway) and start the downloading process, the direct download URL is generated, which I copy from the record that is created in the downloads folder.

My question is how can I create a direct download URL identical to the URL created when I download a file with my browser?

(Just out of curiosity: is the direct download link generated by the browser or by the server hosting the file? Is it possible to determine the format of a direct download link without first passing some query to the file host?)