Skip to content

Instantly share code, notes, and snippets.

@RaccoonDev
Last active August 1, 2017 15:53
Show Gist options
  • Save RaccoonDev/7b1094aee834505f75c622eb575bc7b1 to your computer and use it in GitHub Desktop.
Save RaccoonDev/7b1094aee834505f75c622eb575bc7b1 to your computer and use it in GitHub Desktop.
Download files by list of URL in a text file
import scala.io.Source
import sys.process._
import java.net.URL
import java.io.File
Source.fromFile("name_of_file_that_contains_list_of_urls.txt")
.getLines
.zipWithIndex
.foreach { case(line, count) => new URL(line) #> new File(s"output_file_name_$count.txt") !! }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment