feat: adding initial torrent as arg command

This commit is contained in:
Chubby Granny Chaser 2024-06-27 19:26:04 +01:00
parent a0cc15b5d8
commit 41dc504660
No known key found for this signature in database
4 changed files with 80 additions and 68 deletions

View file

@ -4,9 +4,11 @@ from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import threading
import time
import urllib.parse
torrent_port = sys.argv[1]
http_port = sys.argv[2]
initial_download = json.loads(urllib.parse.unquote(sys.argv[3]))
class Downloader:
def __init__(self):
@ -62,6 +64,8 @@ class Downloader:
downloader = Downloader()
downloader.start_download(initial_download['game_id'], initial_download['magnet'], initial_download['save_path'])
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/status":