|
import concurrent.futures
|
|
import os, curl_cffi.requests as requests
|
|
import time
|
|
from scan import scan
|
|
|
|
|
|
def start_finder():
|
|
try:
|
|
url = 'https://huggingface.co/datasets/ThongCoder/infinite-craft/resolve/main/cache.sqlite'
|
|
filename = 'db/cache.sqlite'
|
|
root_dir = os.path.dirname(os.path.abspath(__file__))
|
|
dest_path = os.path.join(root_dir, filename)
|
|
|
|
print(f"Downloading from: {url}")
|
|
response = requests.get(url, stream=True)
|
|
response.raise_for_status()
|
|
|
|
with open(dest_path, "wb") as f:
|
|
for chunk in response.iter_content(chunk_size=8192):
|
|
f.write(chunk)
|
|
|
|
print(f"Saved to: {dest_path}")
|
|
time.sleep(.5)
|
|
except Exception as e: print(f'Error hit: {e}'); pass
|
|
|
|
while True:
|
|
try: scan(False, .2, 64)
|
|
except concurrent.futures._base.TimeoutError: continue
|
|
except Exception as e: print(f'Unexpected error:\n{e.with_traceback}'); break
|
|
|
|
if __name__ == "__main__":
|
|
start_finder() |