snapshot
This commit is contained in:
+16
-1
@@ -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'
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user