diff --git a/Src/Api/animeunity/Core/Player/vixcloud.py b/Src/Api/animeunity/Core/Player/vixcloud.py index fad7472..d0766c5 100644 --- a/Src/Api/animeunity/Core/Player/vixcloud.py +++ b/Src/Api/animeunity/Core/Player/vixcloud.py @@ -35,7 +35,7 @@ class VideoSource: } self.is_series = False self.base_name = SITE_NAME - self.domain = config_manager.get('SITE', self.base_name) + self.domain = config_manager.get_dict('SITE', self.base_name)['domain'] def setup(self, media_id: int = None, series_name: str = None): """ diff --git a/Src/Lib/Hls/segments.py b/Src/Lib/Hls/segments.py index a89178c..e9432b4 100644 --- a/Src/Lib/Hls/segments.py +++ b/Src/Lib/Hls/segments.py @@ -277,7 +277,9 @@ class M3U8_Segments: # Get config site from prev stack frames = get_call_stack() - config_site = str(os.path.basename(frames[-1]['folder'])).lower() + logging.info(f"Extract info from: {frames}") + config_site = str(frames[-4]['folder_base']) + logging.info(f"Use frame: {frames[-1]}") # Workers to use for downloading TQDM_MAX_WORKER = 0 diff --git a/Src/Util/call_stack.py b/Src/Util/call_stack.py index fba3aae..d3a6969 100644 --- a/Src/Util/call_stack.py +++ b/Src/Util/call_stack.py @@ -15,6 +15,7 @@ def get_call_stack(): list: A list of dictionaries, each containing the following keys: - function (str): The name of the function. - folder (str): The directory path of the script containing the function. + - folder_base (str): The base name of the directory path. - script (str): The name of the script file containing the function. - line (int): The line number in the script where the function is defined. @@ -31,7 +32,7 @@ def get_call_stack(): >>> stack_trace = func_a() >>> for frame in stack_trace: ... print(f"Function: {frame['function']}, Folder: {frame['folder']}, " - ... f"Script: {frame['script']}, Line: {frame['line']}") + ... f"Folder Base: {frame['folder_base']}, Script: {frame['script']}, Line: {frame['line']}") """ stack = inspect.stack() call_stack = [] @@ -41,11 +42,13 @@ def get_call_stack(): filename = frame_info.filename lineno = frame_info.lineno folder_name = os.path.dirname(filename) + folder_base = os.path.basename(folder_name) script_name = os.path.basename(filename) call_stack.append({ "function": function_name, "folder": folder_name, + "folder_base": folder_base, "script": script_name, "line": lineno })