From b9b050fec1a4d74cae3e5e4ba7b88dd80627b521 Mon Sep 17 00:00:00 2001 From: zuckerberg <5-zuckerberg@users.noreply.git.neet.dev> Date: Sat, 2 Oct 2021 17:23:42 -0400 Subject: [PATCH] Direct path to wrapped fusermount --- downloader.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/downloader.py b/downloader.py index 3431103..77a029c 100644 --- a/downloader.py +++ b/downloader.py @@ -90,13 +90,16 @@ def mountTorrent(magnet): print("mounting torrent...") umountTorrent() os.mkdir(fuseTorrentLocation) + + env = dict(os.environ) + env["PATH"] = "/run/wrappers/bin:" + env["PATH"] o = subprocess.Popen([ "btfs", "-o", "auto_unmount", # unmount if process is killed - "-o", "allow_other", "--data-directory=" + btfsDataLocation, magnet, - fuseTorrentLocation + fuseTorrentLocation, + env=env ]) o.communicate() # wait for it to finish sleep(5) # uhhh I guess I need to sleep? @@ -104,9 +107,12 @@ def mountTorrent(magnet): def umountTorrent(): print("unmounting torrent...") if os.path.isdir(fuseTorrentLocation): + env = dict(os.environ) + env["PATH"] = "/run/wrappers/bin:" + env["PATH"] o = subprocess.Popen([ "fusermount", - "-u", fuseTorrentLocation + "-u", fuseTorrentLocation, + env=env ]) o.communicate() # wait for it to finish os.rmdir(fuseTorrentLocation)