Skip to content

Commit

Permalink
forgot to trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
5hojib committed Jan 1, 2025
1 parent f6b1d54 commit aed10b8
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bot/helper/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def __init__(self):
self.subname = ""
self.new_dir = ""
self.name_sub = ""
self.metadata = ""
self.thumbnail_layout = ""
self.folder_name = ""
self.split_size = 0
Expand Down Expand Up @@ -160,6 +161,11 @@ async def before_start(self):
or self.user_dict.get("name_sub", False)
or (Config.NAME_SUBSTITUTE if "name_sub" not in self.user_dict else "")
)
self.metadata = (
self.metadata
or self.user_dict.get("metadata", False)
or (Config.METADATA_KEY if "metadata" not in self.user_dict else "")
)
if self.name_sub:
self.name_sub = [x.split("/") for x in self.name_sub.split(" | ")]
self.seed = False
Expand Down
11 changes: 11 additions & 0 deletions bot/helper/listeners/task_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,17 @@ async def on_download_complete(self):
self.is_file = await aiopath.isfile(up_path)
self.name = up_path.rsplit("/", 1)[1]

if self.metadata:
up_path = await self.proceed_metadata(up_path, gid)
if self.is_cancelled:
return
self.is_file = await aiopath.isfile(up_path)
up_dir, self.name = up_path.rsplit("/", 1)
self.size = await get_path_size(up_dir)
self.subproc = None
self.subname = ""
self.subsize = 0

if self.screen_shots:
up_path = await self.generate_screenshots(up_path)
if self.is_cancelled:
Expand Down
2 changes: 2 additions & 0 deletions bot/modules/mirror_leech.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ async def new_event(self):
"-ca": "",
"-cv": "",
"-ns": "",
"-md": "",
"-tl": "",
"-ff": "None",
}
Expand Down Expand Up @@ -147,6 +148,7 @@ async def new_event(self):
self.thumbnail_layout = args["-tl"]
self.as_doc = args["-doc"]
self.as_med = args["-med"]
self.metadata = args["-md"]
self.folder_name = f"/{args["-m"]}" if len(args["-m"]) > 0 else ""

headers = args["-h"]
Expand Down
2 changes: 2 additions & 0 deletions bot/modules/ytdlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,7 @@ async def new_event(self):
"-ca": "",
"-cv": "",
"-ns": "",
"-md": "",
"-tl": "",
"-ff": "None",
}
Expand Down Expand Up @@ -371,6 +372,7 @@ async def new_event(self):
self.thumbnail_layout = args["-tl"]
self.as_doc = args["-doc"]
self.as_med = args["-med"]
self.metadata = args["-md"]
self.folder_name = f"/{args["-m"]}" if len(args["-m"]) > 0 else ""

is_bulk = args["-b"]
Expand Down

0 comments on commit aed10b8

Please sign in to comment.