Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
get filename for making files easier to find
  • Loading branch information
myp79 committed Jan 15, 2022
1 parent f95e100 commit 41aabc8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import requests


def download(url: str):
def download(url: str, filename: str) -> None:
reg = requests.get(url)
with open('./test.zip', 'wb') as file:
with open('./%s.zip' % filename, 'wb') as file:
file.write(reg.content)


Expand All @@ -15,5 +15,6 @@ def url_format(url: str) -> str:

if __name__ == '__main__':
url = input('URL:\n')
name = input('Filenames:\n')
url = url_format(url)
download(url)
download(url, name)

0 comments on commit 41aabc8

Please sign in to comment.