diff --git a/URLs.py b/URLs.py index 1335270..0010649 100644 --- a/URLs.py +++ b/URLs.py @@ -91,30 +91,17 @@ def wrapper(): """ Example wrapper """ - from alive_progress import alive_bar - with alive_bar(4) as bar: - bar.text("Reading provider file...") - try: - with open("provider") as file: - prov = file.read() - except Exception: - prov = "tiny.cc" - bar() - bar.text("Setting up instance...") - datums = URL(provider=prov) #create instance - time.sleep(0.1) - bar() - bar.text("Getting URL...") - datums.GetURL((1,25)) #get a random url with a length from 1 to 6 - time.sleep(0.1) - bar() - bar.text("Getting redirect...") - 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() #download the url - bar() - bar.text("Writing to file...") - datums.WriteFile() #write to json file - time.sleep(0.1) + try: + with open("provider") as file: + prov = file.read() + except Exception: + prov = "tiny.cc" + datums = URL(provider=prov) #create instance + datums.GetURL((1,25)) #get a random url with a length from 1 to 6 + 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() #download the url + datums.WriteFile() #write to json file + main = wrapper if __name__ == "__main__": main() diff --git a/wrapper.py b/wrapper.py index d5d5f35..12294e1 100644 --- a/wrapper.py +++ b/wrapper.py @@ -1,16 +1,19 @@ -import subprocess, URLs +from alive_progress import alive_bar +import subprocess, URLs, sys print("Infinitely running the file. (To stop this, add a file called \"sotp\" in the working directory.)") -while True: - try: - open("sotp") - except Exception: - pass - else: - print("sotpping") - sys.exit(0) - try: - URLs.main() - except URLs.NonexistentUrl as ename: - print("NonexistentUrl - %s"%ename) - except Exception as ename: - print(f"Error - {ename}") +with alive_bar() as bar: + while True: + try: + open("sotp") + except Exception: + pass + else: + print("sotpping") + sys.exit(0) + try: + URLs.main() + except URLs.NonexistentUrl as ename: + print("NonexistentUrl - %s"%ename) + except Exception as ename: + print(f"Error - {ename}") + bar()