mirror of
https://github.com/anasty17/mirror-leech-telegram-bot.git
synced 2025-01-07 03:26:46 +08:00
minor changes
Signed-off-by: anasty17 <e.anastayyar@gmail.com>
This commit is contained in:
parent
f97076bf49
commit
7f9855f13c
@ -49,7 +49,6 @@ class YoutubeDLHelper:
|
||||
self._eta = "-"
|
||||
self._listener = listener
|
||||
self._gid = ""
|
||||
self._downloading = False
|
||||
self._ext = ""
|
||||
self.is_playlist = False
|
||||
self.opts = {
|
||||
@ -93,7 +92,6 @@ class YoutubeDLHelper:
|
||||
return self._eta
|
||||
|
||||
def _on_download_progress(self, d):
|
||||
self._downloading = True
|
||||
if self._listener.is_cancelled:
|
||||
raise ValueError("Cancelling...")
|
||||
if d["status"] == "finished":
|
||||
@ -336,8 +334,7 @@ class YoutubeDLHelper:
|
||||
async def cancel_task(self):
|
||||
self._listener.is_cancelled = True
|
||||
LOGGER.info(f"Cancelling Download: {self._listener.name}")
|
||||
if not self._downloading:
|
||||
await self._listener.on_download_error("Download Cancelled by User!")
|
||||
await self._listener.on_download_error("Download Cancelled by User!")
|
||||
|
||||
def _set_options(self, options):
|
||||
options = options.split("|")
|
||||
|
@ -314,20 +314,18 @@ class TelegramUploader:
|
||||
self._corrupted += 1
|
||||
if self._listener.is_cancelled:
|
||||
return
|
||||
continue
|
||||
finally:
|
||||
if (
|
||||
not self._listener.is_cancelled
|
||||
and await aiopath.exists(self._up_path)
|
||||
and (
|
||||
not self._listener.seed
|
||||
or self._listener.new_dir
|
||||
or dirpath.endswith("/splited_files_mltb")
|
||||
or "/copied_mltb/" in self._up_path
|
||||
or delete_file
|
||||
)
|
||||
):
|
||||
await remove(self._up_path)
|
||||
if (
|
||||
not self._listener.is_cancelled
|
||||
and await aiopath.exists(self._up_path)
|
||||
and (
|
||||
not self._listener.seed
|
||||
or self._listener.new_dir
|
||||
or dirpath.endswith("/splited_files_mltb")
|
||||
or "/copied_mltb/" in self._up_path
|
||||
or delete_file
|
||||
)
|
||||
):
|
||||
await remove(self._up_path)
|
||||
for key, value in list(self._media_dict.items()):
|
||||
for subkey, msgs in list(value.items()):
|
||||
if len(msgs) > 1:
|
||||
|
Loading…
Reference in New Issue
Block a user