Fix bad linux path.

This commit is contained in:
cronyakatsuki 2022-03-10 19:04:34 +01:00
parent cca11bba20
commit 391439ef9e

9
adl.py
View File

@ -11,8 +11,8 @@ if sys.platform == "win32":
DEFAULT_DOWNLOAD_LOCATION = os.path.join('C:\\', 'Users', str(os.getlogin()), 'Videos', 'Anime') DEFAULT_DOWNLOAD_LOCATION = os.path.join('C:\\', 'Users', str(os.getlogin()), 'Videos', 'Anime')
CLEAR = 'cls' CLEAR = 'cls'
else: else:
CONFIG_FILE_PATH = os.path.join('home', str(os.getlogin()), '.config', 'adl', 'config.json') CONFIG_FILE_PATH = os.path.join('/home', str(os.getlogin()), '.config', 'adl', 'config.json')
DEFAULT_DOWNLOAD_LOCATION = os.path.join('home', str(os.getlogin()), 'Videos', 'Anime') DEFAULT_DOWNLOAD_LOCATION = os.path.join('/home', str(os.getlogin()), 'Videos', 'Anime')
CLEAR = 'clear' CLEAR = 'clear'
PROBLEMATIC_TITLES = ['Komi-san wa, Komyushou desu ', PROBLEMATIC_TITLES = ['Komi-san wa, Komyushou desu ',
@ -113,7 +113,7 @@ def watch(title, episode, download, provider, download_location):
else: else:
cmd.append('stream') cmd.append('stream')
cmd.append(f'"{provider}:{title}"') cmd.append(f'{provider}:{title}')
cmd.append('-r') cmd.append('-r')
cmd.append(episode) cmd.append(episode)
@ -264,6 +264,8 @@ def argument_and_config_parser():
# config # config
config = {} config = {}
ConfigExists = False ConfigExists = False
# print(CONFIG_FILE_PATH)
# sys.exit()
if os.path.exists(CONFIG_FILE_PATH): if os.path.exists(CONFIG_FILE_PATH):
config_content = open(CONFIG_FILE_PATH, encoding='utf-8-sig').read() config_content = open(CONFIG_FILE_PATH, encoding='utf-8-sig').read()
config = eval(config_content) config = eval(config_content)
@ -306,6 +308,7 @@ def argument_and_config_parser():
provider = str(args["provider"]) provider = str(args["provider"])
elif ConfigExists and 'provider' in config and config['provider']: elif ConfigExists and 'provider' in config and config['provider']:
provider = str(config["provider"]) provider = str(config["provider"])
else: else:
provider = "zoro" provider = "zoro"