diff --git a/bot/helper/ext_utils/fs_utils.py b/bot/helper/ext_utils/fs_utils.py index 3be76ed2..86deb1f6 100644 --- a/bot/helper/ext_utils/fs_utils.py +++ b/bot/helper/ext_utils/fs_utils.py @@ -106,7 +106,7 @@ def take_ss(video_file): duration = duration // 2 status = srun(["new-api", "-hide_banner", "-loglevel", "error", "-ss", str(duration), - "-i", video_file, "-vframes", "1", des_dir]) + "-i", video_file, "-frames:v", "1", des_dir]) if status.returncode != 0 or not ospath.lexists(des_dir): return None diff --git a/bot/helper/mirror_utils/upload_utils/gdriveTools.py b/bot/helper/mirror_utils/upload_utils/gdriveTools.py index 68abe4c3..60ee8051 100644 --- a/bot/helper/mirror_utils/upload_utils/gdriveTools.py +++ b/bot/helper/mirror_utils/upload_utils/gdriveTools.py @@ -482,7 +482,7 @@ class GoogleDriveHelper: str = str.replace(char, '\\' + char) return str.strip() - def __get_recursive_list(self, file, rootid = "root"): + def __get_recursive_list(self, file, rootid): rtnlist = [] if not rootid: rootid = file.get('teamDriveId') diff --git a/web/nodes.py b/web/nodes.py index cff4ad4a..7553d5f4 100644 --- a/web/nodes.py +++ b/web/nodes.py @@ -4,7 +4,7 @@ from anytree import NodeMixin class TorNode(NodeMixin): - def __init__(self, name, is_folder=False, is_file=False, parent=None, progress=None, size=None, priority=None, file_id=None): + def __init__(self, name, is_folder=False, is_file=False, parent=None, size=None, priority=None, file_id=None): super().__init__() self.name = name self.is_folder = is_folder @@ -12,8 +12,6 @@ class TorNode(NodeMixin): if parent is not None: self.parent = parent - if progress is not None: - self.progress = progress if size is not None: self.size = size if priority is not None: @@ -38,7 +36,7 @@ def make_tree(res): TorNode: Parent node of the tree constructed and can be used further. """ parent = TorNode("Torrent") - for l, i in enumerate(res): + for i in res: # Get the hierarchy of the folders by splitting based on '/' folders = get_folders(i.name) # Check if the file is alone for if its in folder @@ -63,15 +61,15 @@ def make_tree(res): # if the node is not found then create the folder node # if the node is found then use it as base for the next if current_node is None: - previous_node = TorNode(folders[j],parent=previous_node,is_folder=True) + previous_node = TorNode(folders[j], parent=previous_node, is_folder=True) else: previous_node = current_node # at this point the previous_node will contain the deepest folder in it so add the file to it - TorNode(folders[-1],is_file=True,parent=previous_node,progress=i.progress,size=i.size,priority=i.priority,file_id=l) + TorNode(folders[-1], is_file=True, parent=previous_node, size=i.size, priority=i.priority, file_id=i.id) else: # at the file to the parent if no folders are there - TorNode(folders[-1],is_file=True,parent=parent,progress=i.progress,size=i.size,priority=i.priority,file_id=l) - return parent + TorNode(folders[-1], is_file=True, parent=parent, size=i.size, priority=i.priority, file_id=i.id) + return create_list(parent, ["", 0]) """ def print_tree(parent): @@ -88,7 +86,7 @@ def create_list(par, msg): msg[0] += "