diff --git a/lbrynet/core/LBRYcrdWallet.py b/lbrynet/core/LBRYcrdWallet.py index 4a1cc1c7f..34f6f9d36 100644 --- a/lbrynet/core/LBRYcrdWallet.py +++ b/lbrynet/core/LBRYcrdWallet.py @@ -1,3 +1,4 @@ +import sys from lbrynet.interfaces import IRequestCreator, IQueryHandlerFactory, IQueryHandler, ILBRYWallet from lbrynet.core.client.ClientRequest import ClientRequest from lbrynet.core.Error import UnknownNameError, InvalidStreamInfoError, RequestCanceledError @@ -372,6 +373,8 @@ class LBRYcrdWallet(object): self.lbrycrdd = subprocess.Popen([self.lbrycrdd_path, "-datadir=%s" % self.wallet_dir, "-conf=%s" % self.wallet_conf], startupinfo=si) else: + if sys.platform == 'darwin': + os.chdir("/Applications/LBRY.app/Contents/Resources") self.lbrycrdd = subprocess.Popen([self.lbrycrdd_path, "-datadir=%s" % self.wallet_dir, "-conf=%s" % self.wallet_conf]) self.started_lbrycrdd = True diff --git a/lbrynet/lbrynet_console/LBRYConsole.py b/lbrynet/lbrynet_console/LBRYConsole.py index dc4af02d8..73e817af2 100644 --- a/lbrynet/lbrynet_console/LBRYConsole.py +++ b/lbrynet/lbrynet_console/LBRYConsole.py @@ -4,6 +4,7 @@ import os.path import argparse import requests import locale +import sys from yapsy.PluginManager import PluginManager from twisted.internet import defer, threads, stdio, task, error # from lbrynet.core.client.AutoDownloader import AutoFetcher @@ -65,7 +66,10 @@ class LBRYConsole(): self.lbrycrd_conf = lbrycrd_conf self.lbrycrd_dir = lbrycrd_dir if not self.lbrycrd_dir: - self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd") + if sys.platform == "darwin": + self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), "Library/Application Support/lbrycrd") + else: + self.lbrycrd_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd") if not self.lbrycrd_conf: self.lbrycrd_conf = os.path.join(self.lbrycrd_dir, "lbrycrd.conf") # self.autofetcher_conf = os.path.join(self.lbrycrd_dir, "autofetcher.conf") diff --git a/lbrynet/lbrynet_gui/LBRYGui.py b/lbrynet/lbrynet_gui/LBRYGui.py index 6421ce1d4..dcc20f649 100644 --- a/lbrynet/lbrynet_gui/LBRYGui.py +++ b/lbrynet/lbrynet_gui/LBRYGui.py @@ -20,6 +20,7 @@ from lbrynet.lbryfile.client.LBRYFileOptions import add_lbry_file_to_sd_identifi import os import requests import shutil +import sys from twisted.internet import threads, defer, task @@ -42,8 +43,12 @@ class LBRYDownloader(object): self.download_directory = get_path(FOLDERID.Downloads, UserHandle.current) self.wallet_dir = os.path.join(get_path(FOLDERID.RoamingAppData, UserHandle.current), "lbrycrd") else: - self.download_directory = os.path.join(os.path.expanduser("~"), "Downloads") - self.wallet_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd") + if sys.platform == 'darwin': + self.download_directory = os.path.join(os.path.expanduser("~"), "Downloads") + self.wallet_dir = os.path.join(os.path.expanduser("~"), "Library/Application Support/lbrycrd") + else: + self.download_directory = os.getcwd() + self.wallet_dir = os.path.join(os.path.expanduser("~"), ".lbrycrd") self.wallet_conf = os.path.join(self.wallet_dir, "lbrycrd.conf") self.wallet_user = None self.wallet_password = None @@ -297,6 +302,9 @@ class LBRYDownloader(object): if not lbrycrdd_path: lbrycrdd_path = self.default_lbrycrdd_path + if sys.platform == 'darwin': + os.chdir("/Applications/LBRY.app/Contents/Resources") + wallet = LBRYcrdWallet(self.db_dir, wallet_dir=self.wallet_dir, wallet_conf=self.wallet_conf, lbrycrdd_path=lbrycrdd_path)