diff --git a/legendary/core.py b/legendary/core.py index 6e27a52..0495f93 100644 --- a/legendary/core.py +++ b/legendary/core.py @@ -1654,6 +1654,17 @@ class LegendaryCore: if not max_workers: max_workers = self.lgd.config.getint('Legendary', 'max_workers', fallback=0) + try: + with open(exclude_file_path, 'r', encoding='utf-8') as f: + excludes = [line.strip().replace('\\', '/') for line in f if line.strip()] + + if file_exclude_filter is None: + file_exclude_filter = excludes + else: + file_exclude_filter += excludes + except (OSError, UnicodeError) as e: + self.log.debug('Could not load exclude file "%s", skipping: %s',exclude_file_path, e) + dlm = DLManager(install_path, base_url, manifest_secrets, resume_file=resume_file, status_q=status_q, max_shared_memory=max_shm * 1024 * 1024, max_workers=max_workers, dl_timeout=dl_timeout, bind_ip=bind_ip, case_insensitive=platform.startswith('Win'))