Skip to content

Commit

Permalink
Dir-Leech fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
XronTrix10 committed Oct 10, 2023
1 parent 3fdac21 commit 9d498be
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions colab_leecher/utility/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ async def Leech(folder_path: str, remove: bool):
shutil.rmtree(Paths.temp_zpath)

else:
if not ospath.exists(Paths.temp_files_dir): # Create Directory
makedirs(Paths.temp_files_dir)

if not remove: # Copy To Temp Dir for Renaming Purposes
file_path = shutil.copy(file_path, Paths.temp_files_dir)
file_name = ospath.basename(file_path)
Expand Down
10 changes: 7 additions & 3 deletions colab_leecher/utility/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ async def taskScheduler():

if ospath.exists(Paths.WORK_PATH):
shutil.rmtree(Paths.WORK_PATH)
makedirs(Paths.WORK_PATH)
# makedirs(Paths.WORK_PATH)
makedirs(Paths.down_path)
else:
makedirs(Paths.WORK_PATH)
Expand Down Expand Up @@ -128,7 +128,11 @@ async def taskScheduler():
)

await calDownSize(BOT.SOURCE)
await get_d_name(BOT.SOURCE[0])

if not is_dir:
await get_d_name(BOT.SOURCE[0])
else:
Messages.download_name = ospath.basename(BOT.SOURCE[0])

if is_zip:
Paths.down_path = ospath.join(Paths.down_path, Messages.download_name)
Expand All @@ -137,7 +141,7 @@ async def taskScheduler():

BotTimes.current_time = time()

if BOT.Mode.mode == "leech":
if BOT.Mode.mode != "mirror":
await Do_Leech(BOT.SOURCE, is_dir, BOT.Mode.ytdl, is_zip, is_unzip, is_dualzip)
else:
await Do_Mirror(BOT.SOURCE, BOT.Mode.ytdl, is_zip, is_unzip, is_dualzip)
Expand Down
2 changes: 1 addition & 1 deletion colab_leecher/utility/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Paths:
mirror_dir = "/content/drive/MyDrive/Colab Leecher Uploads"
temp_zpath = f"{WORK_PATH}/Leeched_Files"
temp_unzip_path = f"{WORK_PATH}/Unzipped_Files"
temp_files_dir = f"{WORK_PATH}/dir_leech_temp"
temp_files_dir = f"{WORK_PATH}/leech_temp"
thumbnail_ytdl = f"{WORK_PATH}/ytdl_thumbnails"
access_token = "/content/token.pickle"

Expand Down

0 comments on commit 9d498be

Please sign in to comment.