Guest User

Untitled

a guest
Nov 23rd, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. from urllib3 import disable_warnings
  2. from urllib3.exceptions import InsecureRequestWarning
  3.  
  4. import requests
  5.  
  6. disable_warnings(InsecureRequestWarning)
  7.  
  8. url = input('Please input full URL:\n')
  9. size_of_parts = input('Please input size of file parts in MB:\n')
  10.  
  11. with open(url.split('/')[-1], 'wb') as file:
  12. print('Start downloading...')
  13. response = requests.get(url, stream=True, verify=False)
  14. for chunk in response.iter_content(int(size_of_parts)*1048576):
  15. file.write(chunk)
  16. print('Done')
Add Comment
Please, Sign In to add comment