Last active
February 1, 2017 07:46
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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