Skip to content

Instantly share code, notes, and snippets.

@sunnykrGupta
Last active February 1, 2017 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sunnykrGupta/3b6ec1f935e252d79bd4 to your computer and use it in GitHub Desktop.
Save sunnykrGupta/3b6ec1f935e252d79bd4 to your computer and use it in GitHub Desktop.
Download-files. Feed link in given input files which u wanted to download irrespective of source.
import wget
import os
# Get the list of all the files in current directory
files = [f for f in os.listdir('.') if os.path.isfile(f)]
# Read from file. File contains list of links. All links in new line.
links = open("inputurl.in", "r")
i = 0
# Links in process
for lnk in links:
linkD = lnk.rstrip('\n')
i = i+1
print "Downloading %d - %s..." % (i, linkD)
filename = wget.download(linkD)
print "\nAll downloads complete !! Hurray"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment