Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kalanakt committed Aug 10, 2022
1 parent 7fd8cdd commit 51048df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 33 deletions.
6 changes: 3 additions & 3 deletions Uploader/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ async def youtube_dl_call_back(bot, update):
if entity.type == "text_link":
youtube_dl_url = entity.url
elif entity.type == "url":
o = entity.offset
l = entity.length
youtube_dl_url = youtube_dl_url[o:o + l]
offset = entity.offset
length = entity.length
youtube_dl_url = youtube_dl_url[offset:offset + length]
if youtube_dl_url is not None:
youtube_dl_url = youtube_dl_url.strip()
if custom_file_name is not None:
Expand Down
23 changes: 0 additions & 23 deletions Uploader/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,26 +58,3 @@ async def aboutme(_, m: Message):
reply_markup=Translation.ABOUT_BUTTONS,
disable_web_page_preview=True,
)


@Client.on_message(
filters.private & filters.reply & filters.text
)
async def edit_caption(bot, update):
try:
await bot.send_cached_media(
chat_id=update.chat.id,
file_id=update.reply_to_message.video.file_id,
reply_to_message_id=update.id,
caption=update.text
)
except:
try:
await bot.send_cached_media(
chat_id=update.chat.id,
file_id=update.reply_to_message.document.file_id,
reply_to_message_id=update.id,
caption=update.text
)
except:
pass
14 changes: 7 additions & 7 deletions Uploader/dl_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ async def ddl_call_back(bot, update):
if entity.type == "text_link":
youtube_dl_url = entity.url
elif entity.type == "url":
o = entity.offset
l = entity.length
youtube_dl_url = youtube_dl_url[o:o + l]
offset = entity.offset
length = entity.length
youtube_dl_url = youtube_dl_url[offset:offset + length]
if youtube_dl_url is not None:
youtube_dl_url = youtube_dl_url.strip()
if custom_file_name is not None:
Expand All @@ -73,9 +73,9 @@ async def ddl_call_back(bot, update):
if entity.type == "text_link":
youtube_dl_url = entity.url
elif entity.type == "url":
o = entity.offset
l = entity.length
youtube_dl_url = youtube_dl_url[o:o + l]
offset = entity.offset
length = entity.length
youtube_dl_url = youtube_dl_url[offset:offset + length]

description = custom_file_name
if f".{youtube_dl_ext}" not in custom_file_name:
Expand Down Expand Up @@ -223,7 +223,7 @@ async def ddl_call_back(bot, update):
try:
os.remove(download_directory)
os.remove(thumb_image_path)
except:
except Exception:
pass
time_taken_for_download = (end_one - start).seconds
time_taken_for_upload = (end_two - end_one).seconds
Expand Down

0 comments on commit 51048df

Please sign in to comment.