title: How can I download a video given its URL in JavaScript?
body: <p>I have a URL, for example this:</p>
  
  <pre><code>https://r6---sn-vgqsrn76.googlevideo.com/videoplayback?expire=1566535969&amp;ei=wRxfXezPAoORV-3ogpgK&amp;ip=185.27.134.50&amp;id=o-ALFdSvuvmX_bqDsm4oRW7q9c4igbKlBmECWdISuA4Jxe&amp;itag=22&amp;source=youtube&amp;requiressl=yes&amp;mime=video%2Fmp4&amp;ratebypass=yes&amp;dur=624.175&amp;lmt=1529213992430932&amp;fvip=6&amp;c=WEB&amp;sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cratebypass%2Cdur%2Clmt&amp;sig=ALgxI2wwRAIgZzTTsBPpVznwCvzArBFuSF7Bm3yhcO0rwQdfOjBibnsCIBqf8iHuAwahqi0T6qZ3MNbj8BfLgGo2Y3fPOi96RgEV&amp;redirect_counter=1&amp;cm2rm=sn-aigeey7d&amp;req_id=8f890b1c72fda3ee&amp;cms_redirect=yes&amp;mip=2607:fea8:4d9f:fa68:40a2:35d0:8863:2d17&amp;mm=34&amp;mn=sn-vgqsrn76&amp;ms=ltu&amp;mt=1566514280&amp;mv=m&amp;mvi=5&amp;pl=41&amp;lsparams=mip,mm,mn,ms,mv,mvi,pl&amp;lsig=AHylml4wRQIgSCcxaGd_IpVykCuglJtHwewUuZZIyKKr1FBbNP5MvqsCIQCYQEUoM9SpfpySHA_13lB6SvevIuMvhyFDEcrsX0y0ig==
  </code></pre>
  
  <p>How can I download the video in this URL programmatically through JavaScript? I cannot use PHP, Apache, JQuery etc, only Pure JavaScript and HTML.</p>
  
  <p>I have tried using download.js, but I do not think that is the right approach to download videos. I have also looked/tried at various other websites and Stack Overflow answers, but none of them fixed this issue.</p>
  
  <p>EDIT: The other SO answer that someone suggested will not work since the video is on a different baseurl than my own, which means that </p>
  
  <pre><code>&lt;a href="file" download="filename"&gt; 
  </code></pre>
  
  <p>will not work on Chrome. Doing this just opens the video.</p>