Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import requests
- url = sys.argv[1]
- while url[-1] == "/":
- i = 0
- new_url = ""
- for x in url:
- i += 1
- if i != len(url):
- new_url += x
- url = new_url
- name = url.split("/")[url.count("/")]
- r = requests.get(url)
- print("Downloading {}".format(name))
- with open(name, "w") as fd:
- fd.writelines(r)
Add Comment
Please, Sign In to add comment