File size: 1,076 Bytes
709c473
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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__))  # points to /app
        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()