diff --git a/userge/plugins/utils/utube.py b/userge/plugins/utils/utube.py index c7e0e3aaf..b905bcd2c 100644 --- a/userge/plugins/utils/utube.py +++ b/userge/plugins/utils/utube.py @@ -17,14 +17,14 @@ def yt_getInfo(link): try: - x = ytdl.YoutubeDL().extract_info(link, download=False) + x = ytdl.YoutubeDL({'no-playlist': True}).extract_info(link, download=False) thumb = x.get('thumbnail', '') formats = x.get('formats', [x]) out = "No formats found :(" if formats: out = "--U-ID | Reso. | Extension--\n" for i in formats: - out += f"`{i['format_id']} | {i.get('format_note', None)} | {i.get('ext', None)}`\n" + out += f"`{i.get('format_id','')} | {i.get('format_note', None)} | {i.get('ext', None)}`\n" except ytdl.utils.YoutubeDLError as e: return e else: diff --git a/userge/utils/progress.py b/userge/utils/progress.py index 64ccb2c01..d2d17603b 100644 --- a/userge/utils/progress.py +++ b/userge/utils/progress.py @@ -53,9 +53,9 @@ async def progress(current: int, humanbytes(total), humanbytes(speed), time_to_completion if time_to_completion else "0 s") + if message.text != progress_str: + try: + await message.edit(progress_str) - try: - await message.try_to_edit(progress_str) - - except FloodWait as f_e: - time.sleep(f_e.x) + except FloodWait as f_e: + time.sleep(f_e.x)