This commit is contained in:
2024-12-24 20:49:41 +03:00
parent f8febafacb
commit 2b3521544b
35 changed files with 2043 additions and 767 deletions
+16 -1
View File
@@ -36,6 +36,17 @@ def download_with_aria2(url: str, cwd: Path = Path.cwd(), extra_args: list[str]
subprocess.run(args, text=True, cwd=str(cwd.resolve()))
def download_torrent(torrent_path: Path):
res = http.put('/torrents/addTorrent', content=torrent_path.read_bytes())
res.raise_for_status()
data = res.json()
res = http.get(f'/torrents/info/{data["id"]}')
res.raise_for_status()
data = res.json()
print()
def parse_args():
arger = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
arger.add_argument('url', help='URL to unrestrict & download')
@@ -66,4 +77,8 @@ def main():
if __name__ == "__main__":
main()
download_torrent(
Path(
'/Users/abdus/Downloads/[Empornium][PornWorld] All Her Holes Pounded Hard [Veronica Leal] [1080p] {Se7enSeas} [x265].torrent'
)
)