Skip to content

Instantly share code, notes, and snippets.

@shravankumar147
Created March 20, 2018 18:31
Show Gist options
  • Save shravankumar147/3f7f8482e06fd15a5b7922374f076075 to your computer and use it in GitHub Desktop.
Save shravankumar147/3f7f8482e06fd15a5b7922374f076075 to your computer and use it in GitHub Desktop.
File download using different methods
import os
cmd = "wget -c --progress=bar https://docs.microsoft.com/en-us/azure/cognitive-services/face/images/landmarks.1.jpg"
os.system(cmd)
from parallel_sync import wget
url1 = 'https://www.songsmp3.co/assets/images/3/96997-Collaboration%20(2017)%20-%20DJ%20Harsh%20Bhutani.jpg'
url2 = "https://github.com/kouroshparsa/parallel_sync/archive/master.zip"
url3 = ["http://songspkdload.com/Bollywood/Tubelight-Songspksongspke.com/Naach%20Meri%20Jaan-Songspksongspkt.com.mp3"]
wget.download("/tmp", urls=url3)
from tqdm import tqdm
import requests
url = raw_input("Please provide link to download: ")
response = requests.get(url, stream=True)
fname = raw_input("file name to be saveas: ")
with open(fname, "wb") as handle:
for data in tqdm(response.iter_content()):
handle.write(data)
import wget
url = ['http://www.futurecrew.com/skaven/song_files/mp3/razorback.mp3', https://www.songsmp3.co/assets/images/3/96997-Collaboration%20(2017)%20-%20DJ%20Harsh%20Bhutani.jpg]
filename = wget.download(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment