How do you create a file input stream in Scala to download a video from a URL?

907 Views Asked by At

I am trying to download the bytecode from a video hosted on facebook CDN with a URL to the video they provide. I am trying to use the approach of creating a fileinputStream, but I don't see that much documentation around this for Scala. I am trying to do this in the Lift framework in scala.

1

There are 1 best solutions below

0
Farhan Islam On

https://alvinalexander.com/scala/scala-how-to-download-url-contents-to-string-file

It is possible to save files from a URL through this method:

import sys.process._
import java.net.URL
import java.io.File
new URL("http://google.com") #> new File("Output.html") !!