Update URLs.py

This commit is contained in:
TheTechRobo 2021-05-27 16:43:17 -04:00 committed by GitHub
parent ce7da49385
commit 1f1d462f9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

15
URLs.py
View File

@ -44,12 +44,15 @@ class URL:
with open("file.json","w+") as file:
file.write(json.dumps(self.urls))
def main():
datums = URL()
datums.GetURL()
def wrapper():
"""
Example wrapper
"""
datums = URL() #create instance
datums.GetURL() #get a random url
print(f"Pinging URL {datums.url}") #you can also modify datums.url, you can use that for tracker stuff (just make a wrapper that changes this variable as necessary instead of running GetURL())
datums.GetDownload()
datums.WriteFile()
datums.GetDownload() #download the url
datums.WriteFile() #write to json file
main = wrapper
if __name__ == "__main__":
main()